Skip to content

Cookbook: Running MIK on Windows

Mark Jordan edited this page Apr 29, 2018 · 16 revisions

Even though MIK is developed on Mac OSX and Linux, in general it runs fine on Windows. You may want to review the MIK issues labelled 'Windows'.

Here is a summary of some things you should know:

  • MIK runs in a variety of Windows command-line shells. We recommend running MIK in Git Bash, which is part of Git for Windows. In a Windows command shell and in PowerShell, post-write hook scripts sometimes fail and cause the error Fatal Error Unable to reattach to base address to occur. If this happens, comment out the following line in your php.ini file: opcache.enable_cli=1 .
    • There is a problem with Git Bash however: the MIK .ini file must be in the same directory as the mik script. For example, this works: php mik --config=cartoons_config.ini, but this does not: php --config=mikconfigs/cartoons_config.ini. There seems to be no way to escape the directory separator.
  • Some PHPUnit tests incorrectly fail.
  • Windows junction points may not work.
  • On Windows, file paths in .ini files must follow certain conventions. Some examples, with explanations in comments, are provided in the following .ini file:
; MIK configuration file for the SFU Editorial Cartoons Collection.

[CONFIG]
config_id = cartoons
last_updated_on = "2016-01-13"
last_update_by = "mj"

[FETCHER]
class = Csv
; Paths like this work.
input_file = "m:\mikdata\cartoons.csv"
temp_directory = "m:\mik_output\cartoons_temp"
field_delimiter = ","
record_key = "CartoonID"

[METADATA_PARSER]
; This is not a file path, it's a class name with a namespace.
class = mods\CsvToMods
; Paths like this work too. This path is relative to the mik script.
mapping_csv_path = mikconfigs/cartoons_mappings.csv

[FILE_GETTER]
class = CsvSingleFile
input_directory = "m:\mikdata\cartoons_data\cartoons_tiffs"
temp_directory = "m:\mik_output\cartoons_temp"
file_name_field = File

[WRITER]
class = CsvSingleFile
output_directory = "m:\mik_output\cartoons_output"
preserve_content_filenames = false
; Post-write hook scripts use escaped backslashes, since they are run in a shell.
postwritehooks[] = "php m:\\mik_mark\\extras\\scripts\\postwritehooks\\validate_mods.php"

[MANIPULATORS]
; Some manipulators take a path as an argument. This path works.
fetchermanipulators[] = "SpecificSet|m:\mik_mark\mikconfigs\cartoons_set.txt"
metadatamanipulators[] = "FilterModsTopic|subject"
metadatamanipulators[] = "AddUuidToMods"

[LOGGING]
path_to_log = "m:\mik_output\cartoons_output\mik.log"
path_to_manipulator_log = "m:\mik_output\cartoons_output\manipulator.log"

The last issue with running MIK on Windows is that the progress bar on Linux and OS X, which is made possible by the awesome CLImate PHP component:

./mik --config=foo.ini
Creating 10 Islandora ingest packages. Please be patient.
==================================================>                          56%

doesn't work on Windows. To provide some feedback that MIK is doing something, when MIK is running in Windows we print out a period for each object that is processes, so the output looks like this:

$ php mik --config=cartoons_config.ini
Commencing MIK.
Filtering 9831 records through the SpecificSet fetcher manipulator.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.......................................
(and so on)

Once this issue is resolved with CLImate, we'll resolve it with MIK.

Cookbook table of contents

Clone this wiki locally