diff --git a/src/Command/CheckFixityCommand.php b/src/Command/CheckFixityCommand.php index 042b5e6..b992c01 100644 --- a/src/Command/CheckFixityCommand.php +++ b/src/Command/CheckFixityCommand.php @@ -117,11 +117,6 @@ protected function execute(InputInterface $input, OutputInterface $output) // that digest with a new one. if (count($this->persistPlugins) > 0) { foreach ($this->persistPlugins as $persist_plugin_name) { - - $this->event_detail = new FixityEventDetailManager($this->params); - $this->event_detail->add('event_detail', 'wassup.'); - // var_dump($this->event_detail->getDetails()); - $json_object_array = json_decode($resource_id, true); $resource_id = $json_object_array['resource_id']; $last_modified_timestamp = $json_object_array['last_modified_timestamp']; @@ -202,11 +197,14 @@ protected function execute(InputInterface $input, OutputInterface $output) $current_digest_value = $current_digest_plugin_output['digest_value']; } else { $current_digest_plugin_output_ok = false; - } + } - // Initialize $outcome to 'fail', change it to 'success' only if conditions are met. - $outcome = 'fail'; if ($current_digest_plugin_output_ok) { + // Initialize $outcome to 'fail', change it to 'success' only if conditions are met. + $outcome = 'fail'; + print "Pre\n"; + $this->event_detail = new FixityEventDetailManager($this->params); + print "Post\n"; // var_dump("reference_event_digest_value"); // var_dump($reference_event_digest_value); @@ -246,7 +244,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // } } } else { - $this->logger->error("Fetchdigest plugin ran.", array( + $this->logger->error("Fetchdigest plugin ran but could not fetch digest.", array( 'plugin_name' => $this->fetchDigestPlugin, 'return_code' => $get_current_digest_plugin_return_code, 'http_response_code' => $current_digest_plugin_return_value, @@ -266,14 +264,17 @@ protected function execute(InputInterface $input, OutputInterface $output) '--outcome' => $outcome, '--operation' => 'persist_fix_event', )); + + // Aaarrrgggghhhh! $this->event_detail is getting squashed in the persist plugin. + // var_dump($this->event_detail->getDetails()); + $persist_fix_event_plugin_output = new BufferedOutput(); $persist_fix_event_plugin_return_code = $persist_fix_event_plugin_command->run( $persist_fix_event_plugin_input, $persist_fix_event_plugin_output, $this->event_detail ); - // Currently not used. - // $persist_fix_event_plugin_output_string = $persist_fix_event_plugin_output->fetch(); + $this->logger->info( "Persist plugin ran.", array( diff --git a/src/Command/PluginFetchDigestFromShell.php b/src/Command/PluginFetchDigestFromShell.php index f040d19..892a933 100644 --- a/src/Command/PluginFetchDigestFromShell.php +++ b/src/Command/PluginFetchDigestFromShell.php @@ -48,7 +48,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $file_path = $input->getOption('resource_id'); - var_dump("From plugin"); + var_dump("From fetchdigest plugin"); var_dump($file_path); $external_digest_program_command = $this->external_program . ' ' . $file_path; $external_digest_program_command = escapeshellcmd($external_digest_program_command); diff --git a/src/Command/PluginPersistToCsv.php b/src/Command/PluginPersistToCsv.php index 85ee57b..81c6e4f 100644 --- a/src/Command/PluginPersistToCsv.php +++ b/src/Command/PluginPersistToCsv.php @@ -34,6 +34,7 @@ public function __construct( // Set log output path in config/packages/{environment}/monolog.yaml $this->logger = $logger; $this->event_detail = $event_detail; + var_dump("From persist plugin"); var_dump($this->event_detail->getDetails()); parent::__construct(); diff --git a/src/Service/FixityEventDetailManager.php b/src/Service/FixityEventDetailManager.php index 6518669..912ea64 100644 --- a/src/Service/FixityEventDetailManager.php +++ b/src/Service/FixityEventDetailManager.php @@ -21,6 +21,7 @@ public function __construct(ParameterBagInterface $params = null) } else { $this->serialize_delimiter = ';'; } + var_dump("Hi from the event detail manager"); } /** @@ -35,7 +36,7 @@ public function __construct(ParameterBagInterface $params = null) * Associative array with 'event_detail' and 'event_outcome_detail_note' * as keys whose values are an array of strings. */ - public function add($key, $value) + public function add($key, $value = '') { if (!strlen($value)) { return $this->event_details;