/** * @inheritdoc * @throws ExporterException */ public function export() { $this->validate(); foreach ($this->game->getEvents() as $event) { file_put_contents($this->path, $event->describe() . "\n", FILE_APPEND | LOCK_EX); } }
/** * @inheritdoc * @throws ExporterException */ public function export() { foreach ($this->game->getEvents() as $event) { if (strlen($event->describe()) > 1) { $this->command->climate->out($event->describe()); } else { // DEBUG -- If this happens something wasn't parsed properly var_dump($event); } } }
/** * @inheritdoc */ public function export() { $this->prepare(); foreach ($this->game->getEvents() as $event) { $filePath = $this->path . DIRECTORY_SEPARATOR . $this->getOption('nameFormat'); $filePath = str_replace('%EVENTTYPE%', $event->getType(), $filePath); if (!file_exists($filePath)) { // First write the column headers file_put_contents($filePath, implode(',', $this->getHeadersForEvent($event)) . "\n", FILE_APPEND | LOCK_EX); } file_put_contents($filePath, $this->getEventAsLine($event) . "\n", FILE_APPEND | LOCK_EX); } return true; }