/** * Write messages to build log. * * @param \KevinDierkx\Muse\Events\Console\Satis\WriteEventInterface $event * @return bool */ protected function writeToLog(WriteEventInterface $event) { $buildFile = 'build/build-' . $event->getBuildAt()->format('YmdHis') . '.log'; if (!$event->getNewline()) { return false; } if (is_array($messages = $event->getMessages())) { return $this->storage->append($buildFile, implode(PHP_EOL, $event->getMessages())); } return $this->storage->append($buildFile, $messages); }
/** * Append to a file. * * @param string $path * @param string $data * * @return int */ public function append($path, $data) { $path = $this->getPathPrefix($path); return $this->drive->append($path, $data); }