示例#1
0
 /**
  * {@inheritdoc}
  */
 protected function doWrite($message, $newline)
 {
     if ($newline) {
         $message .= "\n";
     }
     $this->task->addOutput($message);
 }
示例#2
0
文件: Runner.php 项目: tenside/core
 /**
  * Called upon PHP shutdown.
  *
  * @return void
  */
 public function handleError()
 {
     if (!$this->shutdownHandlerActive) {
         return;
     }
     $error = error_get_last();
     if ($error['type'] === E_ERROR) {
         $message = sprintf('Error: "%s" in %s on %s', $error['message'], $error['file'], $error['line']);
         $this->task->markError();
         $this->task->addOutput($message);
         $this->logger->error($message);
     }
     // Ensure to release the lock.
     $this->releaseLock();
 }