array( 'title' => 'User Error', 'class' => 'error' ), E_CORE_ERROR => array( 'title' => 'Core Error', 'class' => 'error' ), E_NOTICE => array( 'title' => 'Notice', 'class' => 'notice' ), E_USER_NOTICE => array( 'title' => 'User Notice', 'class' => 'notice' ), E_DEPRECATED => array( 'title' => 'Deprecated', 'class' => 'notice' ), E_USER_DEPRECATED => array( 'title' => 'User Deprecated', 'class' => 'notice' ), E_CORE_ERROR => array( 'title' => 'Core Error', 'class' => 'error' ), E_WARNING => array( 'title' => 'Warning', 'class' => 'warning' ), E_CORE_WARNING => array( 'title' => 'Core Warning', 'class' => 'warning' ), E_USER_WARNING => array( 'title' => 'User Warning', 'class' => 'warning' ), E_STRICT => array( 'title' => 'Strict Notice', 'class' => 'notice' ) ); /** * Generate breadcrumb links to the URL path being displayed * * @return string */ public function Breadcrumbs() { $basePath = str_replace(Director::protocolAndHost(), '', Director::absoluteBaseURL()); $relPath = parse_url(substr($_SERVER['REQUEST_URI'], strlen($basePath), strlen($_SERVER['REQUEST_URI'])), PHP_URL_PATH); $parts = explode('/', $relPath); $base = Director::absoluteBaseURL(); $pathPart = ""; $pathLinks = array(); foreach($parts as $part) { if ($part != '') { $pathPart .= "$part/"; $pathLinks[] = "$part"; } } return implode(' → ', $pathLinks); } /** * Render HTML header for development views */ public function writeHeader() { $url = htmlentities( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'], ENT_COMPAT, 'UTF-8' ); $debugCSS = Controller::join_links( Director::absoluteBaseURL(), FRAMEWORK_DIR, 'css/debug.css' ); echo '
$description
"; } else { echo $this->Breadcrumbs(); } echo 'Line $errline in $errfile
"; echo '';
foreach($lines as $offset => $line) {
$line = htmlentities($line, ENT_COMPAT, 'UTF-8');
if ($offset == $errline) {
echo "$offset $line";
} else {
echo "$offset $line";
}
}
echo '';
}
/**
* Write a backtrace
*/
public function writeTrace($trace) {
echo '' . $text . '
'; } /** * Formats the caller of a method * * @param array $caller * @return string */ protected function formatCaller($caller) { $return = basename($caller['file']) . ":" . $caller['line']; if(!empty($caller['class']) && !empty($caller['function'])) { $return .= " - {$caller['class']}::{$caller['function']}()"; } return $return; } /** * Outputs a variable in a user presentable way * * @param object $val * @param array $caller Caller information */ public function writeVariable($val, $caller) { echo '';
echo "" . $this->formatCaller($caller). " - \n";
if (is_string($val)) print_r(wordwrap($val, self::config()->columns));
else print_r($val);
echo '';
}
}