コード例 #1
0
ファイル: exception.php プロジェクト: Kheros/MMOver
 /**
  * Creates a string representation of the error.
  * This is useful when logging or mailing the error and displays full details
  * of the error and where it occurred, including a full stack trace.
  *
  * @param bool $verbose					- Whether to display full details
  * @return string
  */
 public function toString($verbose = false)
 {
     // Build string
     $str = $this->message . "\r\n";
     // Add details
     if ($verbose) {
         $str .= "********************\r\n";
         $str .= 'Occured in file: ' . $this->file . " on line {$this->line}\r\n";
         $str .= 'Current Route: ' . vB_Router::getCurrentRoute() . "\r\n";
         $str .= 'Initial Route: ' . vB_Router::getInitialRoute() . "\r\n";
         $str .= 'Time: ' . date('l dS \\of F Y h:i:s A') . "\r\n";
         $str .= "Stack Trace:\n" . $this->getTraceAsString() . "\r\n";
     }
     return $str;
 }