null, 'test' => array()); if (!isset($box['type']) && !isset($box['test'][$type])) { $r = Router::requestRoute(); /* if (!preg_match("/gridData/", $_SERVER['REQUEST_URI'])) { */ /* print("
Route:\n");print_r($r);print("\n
\n"); */ /* } */ $box['test'][$type] = !empty($r[3]["${type}_route"]); if ($box['test'][$type]) $box['type'] = $type; } return $box['type'] == $type; } function sandbox() { return _box('sand'); } function devbox() { return _box('dev'); } function server_request_var($var) { if (preg_match("/^HTTP_ACCEPT|REMOTE_PORT/", $var)) return false; return (preg_match("/^HTTP|REQUEST|REMOTE/", $var)); } function INTERNAL_ERROR($message, $exit = true, $drop = 0) { $O = new Object(); for ($i=0; $i<3; ++$i) { $O->log(str_repeat("\\", 80)); $O->log(str_repeat("/", 80)); } $O->log("INTERNAL ERROR: $message"); echo '
' . "\n"; echo '

INTERNAL ERROR:

' . "\n"; echo '

' . $message . '

' . "\n"; echo '

This error was not caused by anything that you did wrong.' . "\n"; echo '
It is a problem within the application itself and should be reported to the administrator.

' . "\n"; // Print out the entire stack trace $O->log(str_repeat("-", 30)); $O->log("Stack:"); echo '
' . "\nStack Trace:\n"; echo '
    ' . "\n"; $trace = array_slice(debug_backtrace(false), $drop); for ($i = 0; $i < count($trace); ++$i) { $bline = $trace[$i]['line']; $bfile = $trace[$i]['file']; $bfile = str_replace(ROOT.DS, '', $bfile); $bfile = str_replace(CAKE_CORE_INCLUDE_PATH.DS, '', $bfile); if ($i < count($trace)-1) { $bfunc = $trace[$i+1]['function']; $bclas = $trace[$i+1]['class']; } else { $bfunc = null; $bclas = null; } $O->log(" $bfile:$bline (" . ($bclas ? "$bclas::$bfunc" : "entry point") . ")"); echo("
  1. $bfile:$bline (" . ($bclas ? "$bclas::$bfunc" : "entry point") . ")
  2. \n"); } echo "
\n"; $O->log(str_repeat("-", 30)); $O->log("HTTP Request:"); echo '
' . "\nHTTP Request:\n"; echo '\n"; $O->log(str_repeat("-", 30)); $O->log("Server:"); $SRV = array_intersect_key($_SERVER, array_flip(array_filter(array_keys($_SERVER), 'server_request_var'))); echo '
' . "\nServer:\n"; echo '\n"; echo '
' . "\n"; echo date('c') . "
\n"; echo '
'; if ($exit) die(); } /** * The settings below can be used to set additional paths to models, views and controllers. * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) * * $modelPaths = array('full path to models', 'second full path to models', 'etc...'); * $viewPaths = array('this path to views', 'second full path to views', 'etc...'); * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...'); * */ //EOF ?>