Skip to content

Commit

Permalink
Replaced with variable as they contained the same values, but is assi…
Browse files Browse the repository at this point in the history
…gned using the config class.
  • Loading branch information
Marcus Emmanuel Barnes committed May 13, 2015
1 parent afb5e63 commit cf6fd95
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions mik
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ if (!file_exists($options['config'])) {
exit("Sorry, can't find " . $options['config'] . "\n");
}

$ini = parse_ini_file($configPath, true);
// print_r($ini);

if (isset($options['limit'])) {
$limit = $options['limit'];
} else {
Expand All @@ -36,7 +33,7 @@ $mikConfig = new Config($configPath);
$settings = $mikConfig->settings;

// Fetch records
$fetcherClass = 'mik\\fetchers\\' . $ini['FETCHER']['class'];
$fetcherClass = 'mik\\fetchers\\' . $settings['FETCHER']['class'];
$fetcher = new $fetcherClass($settings);
//echo $fetcher->echoPhrase("The $fetcherClass class has been loaded.");
//echo $fetcher->testMethod();
Expand All @@ -50,7 +47,7 @@ echo "Getting file information.\n";
echo "Please be patient as this may take some time.\n";

// When finished, the file getter will return some files... whatever that means.
$fileGetterClass = 'mik\\filegetters\\' . $ini['FILE_GETTER']['class'];
$fileGetterClass = 'mik\\filegetters\\' . $settings['FILE_GETTER']['class'];
$fileGetter = new $fileGetterClass($settings);

// Create and Export Islandora ingest packages
Expand All @@ -59,7 +56,7 @@ foreach ($fetcher->getRecords($limit)->records as $record) {
$record_id = $record->pointer;

// Parse metadata
$metadtaClass = 'mik\\metadataparsers\\' . $ini['METADATA_PARSER']['class'];
$metadtaClass = 'mik\\metadataparsers\\' . $settings['METADATA_PARSER']['class'];
$parser = new $metadtaClass($settings);
echo $parser->echoPhrase("The $metadtaClass class been loaded for CONTENTdm record $record_id.\n");

Expand All @@ -81,7 +78,7 @@ foreach ($fetcher->getRecords($limit)->records as $record) {

// When finished, the writer will have written to their final destination the XML file for each object, and all
// files retrieved, modfied, or generated by the file getters and manipulaters.
$writerClass = 'mik\\writers\\' . $ini['WRITER']['class'];
$writerClass = 'mik\\writers\\' . $settings['WRITER']['class'];
$writer = new $writerClass($settings);
$writer->writePackages($metadata, $child_pointers);

Expand Down

0 comments on commit cf6fd95

Please sign in to comment.