Loading src/Certic/Circe/JobResult.php +25 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,31 @@ class JobResult } } public function getDocuments(): \Iterator { foreach($this->getFiles() as $file) { if (!in_array($file->getFileName(), ['out.log', 'job.json'])) { yield $file; } } } public function getLog(): \Iterator { foreach ($this->getFiles() as $file){ if($file->getFileName() == 'out.log'){ $content = file_get_contents((string)$file); $lines = explode(PHP_EOL, $content); foreach ($lines as $line){ $entry = json_decode($line, true); if($entry){ yield $entry; } } } } } public function __destruct() { @\unlink($this->result_file_path); Loading Loading
src/Certic/Circe/JobResult.php +25 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,31 @@ class JobResult } } public function getDocuments(): \Iterator { foreach($this->getFiles() as $file) { if (!in_array($file->getFileName(), ['out.log', 'job.json'])) { yield $file; } } } public function getLog(): \Iterator { foreach ($this->getFiles() as $file){ if($file->getFileName() == 'out.log'){ $content = file_get_contents((string)$file); $lines = explode(PHP_EOL, $content); foreach ($lines as $line){ $entry = json_decode($line, true); if($entry){ yield $entry; } } } } } public function __destruct() { @\unlink($this->result_file_path); Loading