Beispiel #1
0
 /**
  * @param \Exception|\Throwable $e
  *
  * @return string
  */
 protected static function renderForCli($e)
 {
     if (isset($_SERVER['argv']) && is_array($_SERVER['argv'])) {
         $uri = implode(' ', $_SERVER['argv']);
     } else {
         $uri = 'n/a';
     }
     $message = get_class($e) . ' - ' . $e->getMessage();
     $errorString = PHP_EOL . APPLICATION . ' Exception: ' . $message . PHP_EOL;
     $errorString .= 'in ' . $e->getFile() . ' (' . $e->getLine() . ')';
     $errorString .= PHP_EOL . PHP_EOL;
     $errorString .= 'Command: ' . $uri;
     $errorString .= PHP_EOL . PHP_EOL;
     $errorString .= 'Trace:' . PHP_EOL;
     $errorString .= $e->getTraceAsString() . PHP_EOL;
     $version = new Version();
     if ($version->hasData()) {
         $errorString .= 'DeployInfo (Revision: ' . $version->getRevision() . ', Path: ' . $version->getPath() . ', Date: ' . $version->getDate() . ')' . PHP_EOL;
     }
     if ($e instanceof AbstractErrorRendererException) {
         $errorString .= PHP_EOL . PHP_EOL . (string) $e->getExtra();
     }
     return $errorString;
 }
Beispiel #2
0
 /**
  * @return array
  */
 public function indexAction()
 {
     $revisionInfo = Version::getRevTxt();
     return $this->viewResponse(['revisionInfo' => $revisionInfo]);
 }