status_code = 500;
$this->content = Pluf_HTTP_Response_ServerErrorDebug_Pretty($e);
}
}
/**
* @credits http://www.sitepoint.com/blogs/2006/04/04/pretty-blue-screen/
*/
function Pluf_HTTP_Response_ServerErrorDebug_Pretty($e)
{
$o = create_function('$in','return htmlspecialchars($in);');
$sub = create_function('$f','$loc="";if(isset($f["class"])){
$loc.=$f["class"].$f["type"];}
if(isset($f["function"])){$loc.=$f["function"];}
if(!empty($loc)){$loc=htmlspecialchars($loc);
$loc="$loc";}return $loc;');
$parms = create_function('$f','$params=array();if(isset($f["function"])){
try{if(isset($f["class"])){
$r=new ReflectionMethod($f["class"]."::".$f["function"]);}
else{$r=new ReflectionFunction($f["function"]);}
return $r->getParameters();}catch(Exception $e){}}
return $params;');
$src2lines = create_function('$file','$src=nl2br(highlight_file($file,TRUE));
return explode("
",$src);');
$clean = create_function('$line','return trim(strip_tags($line));');
$desc = get_class($e)." making ".$_SERVER['REQUEST_METHOD']." request to ".
$_SERVER['REQUEST_URI'];
$out = '
PHP | '.$o($e->getFile()).', line '.$o($e->getLine()).' |
---|---|
URI | '.$o($_SERVER['REQUEST_METHOD'].' '. $_SERVER['REQUEST_URI']).' |
Arg | Name | Value |
---|---|---|
'.$o($k).' | '.$o($name).' |
'.Pluf_esc(print_r($v, true)).' |
'.$clean($line).'
'.
$clean($line).'
';
foreach ($req_headers as $req_h_name => $req_h_val) {
$out .= $o($req_h_name.': '.$req_h_val);
$out .= '
';
}
$out .= '
No headers.
'; } $req_body = file_get_contents('php://input'); if ( strlen( $req_body ) > 0 ) { $out .='
'.$o($req_body).'
Variable | Value |
---|---|
'.$o($k).' |
'.$o(print_r($v,TRUE)).'
|
No data
'; } } $out .= '';
foreach ( $resp_headers as $resp_h ) {
$out .= $o($resp_h);
$out .= '
';
}
$out .= '
No headers.
'; } $out .= '