Closed mjordan closed 7 years ago
I added a post-write hook script that allows files of varying content models (e.g., PDF, large image, video) to be processed at the same time. The script will move the payload file plus the corresponding MODS XML file to a content-model specific directory where they can be ingested via Drush (for example). To use it, add the following setting to your .ini file:
[WRITER]
postwritehooks[] = "/usr/bin/php extras/scripts/postwritehooks/move_packages_by_extension.php"
The output paths in the script will need to be configured to suit local needs.
Tested on my environment. PHPunit reports OK (52 tests, 72 assertions)
as expected. I still need to test the new post-write hook script.
Thanks @MarcusBarnes. I'm OK if you skip testing the post-write hook script.
@mjordan I tested it and it worked as expected. One question I had was that you actually wanted to move the packages or did you want to copy? I suppose the idea is to have this post-write hook script run last after other post-write scripts. That said, it's a another nice example of post-write functionality in MIK. Thanks!
My intent was to move the packages, not copy them. Thanks again for reviewing and merging.
I'll update https://github.com/MarcusBarnes/mik/wiki/Cookbook:-Using-the-Filesystem-fetcher with mention of the move script.
Done, and linked, along with the Excel fetcher, from the Cookbook home page.
Github issue: #408
What does this Pull Request do?
Adds a fetcher that uses a directory scan instead of an input file, in effect allowing you to use MIK to generate packages without any metadata. This fetcher is a drop-in replacement for the Csv fetcher in Csv toolchains.
What's new?
How should this be tested?
This change is testable. To test:
phpunit --exclude-group inputvalidators --bootstrap vendor/autoload.php tests
. You should get 52 tests, 72 assertions.Additional Notes
Draft cookbook entry is at https://github.com/MarcusBarnes/mik/wiki/Cookbook:-Using-the-Filesystem-fetcher (toolchain docs not updated yet).
Only works with single-file objects, but we can add compound and books and newspaper issues later.
I've tested this new fetcher on Linux and Windows and it works as intended.
Interested parties
@MarcusBarnes