71 "sublime" =>
"subl://open?url=file://%file&line=%line",
72 "textmate" =>
"txmt://open?url=file://%file&line=%line",
73 "emacs" =>
"emacs://open?url=file://%file&line=%line",
74 "macvim" =>
"mvim://open/?url=file://%file&line=%line",
82 if (ini_get(
'xdebug.file_link_format') || extension_loaded(
'xdebug')) {
84 $this->editors[
'xdebug'] =
function (
$file, $line) {
85 return str_replace(array(
'%f',
'%l'), array(
$file, $line), ini_get(
'xdebug.file_link_format'));
90 $this->searchPaths[] = __DIR__ .
"/../Resources";
101 if (php_sapi_name() ===
'cli') {
104 if (isset($_ENV[
'whoops-test'])) {
105 throw new \Exception(
106 'Use handleUnconditionally instead of whoops-test' 107 .
' environment variable' 118 $templateFile = $this->
getResource(
"views/layout.html.php");
119 $cssFile = $this->
getResource(
"css/whoops.base.css");
120 $zeptoFile = $this->
getResource(
"js/zepto.min.js");
123 if ($this->customCss) {
124 $customCssFile = $this->
getResource($this->customCss);
132 if (
$inspector->getException() instanceof \ErrorException) {
141 "stylesheet" => file_get_contents($cssFile),
142 "zepto" => file_get_contents($zeptoFile),
143 "javascript" => file_get_contents($jsFile),
146 "header" => $this->
getResource(
"views/header.html.php"),
147 "frame_list" => $this->
getResource(
"views/frame_list.html.php"),
148 "frame_code" => $this->
getResource(
"views/frame_code.html.php"),
149 "env_details" => $this->
getResource(
"views/env_details.html.php"),
152 "name" => explode(
"\\",
$inspector->getExceptionName()),
153 "message" =>
$inspector->getException()->getMessage(),
157 "has_frames" => !!count($frames),
159 "handlers" => $this->
getRun()->getHandlers(),
168 "Environment Variables" => $_ENV,
172 if (isset($customCssFile)) {
173 $vars[
"stylesheet"] .= file_get_contents($customCssFile);
179 return $table instanceof \Closure ? $table() : $table;
181 $vars[
"tables"] = array_merge(
$extraTables, $vars[
"tables"]);
183 $helper->setVariables($vars);
184 $helper->render($templateFile);
198 $this->extraTables[$label] =
$data;
213 if (!is_callable($callback)) {
217 $this->extraTables[$label] =
function () use ($callback) {
219 $result = call_user_func($callback);
239 if ($label !== null) {
240 return isset($this->extraTables[$label]) ?
241 $this->extraTables[$label] : array();
256 if (func_num_args() == 0) {
281 $this->editors[$identifier] = $resolver;
302 "Unknown editor identifier: $editor. Known editors:" .
303 implode(
",", array_keys($this->editors))
323 if ($this->editor === null) {
340 __METHOD__ .
" should always resolve to a string; got something else instead" 356 $this->pageTitle = (string) $title;
378 if (!is_dir(
$path)) {
380 "'$path' is not a valid directory" 384 array_unshift($this->searchPaths,
$path);
395 $this->customCss = $name;
421 if (isset($this->resourceCache[$resource])) {
422 return $this->resourceCache[$resource];
427 foreach ($this->searchPaths as
$path) {
428 $fullPath = $path .
"/$resource";
430 if (is_file($fullPath)) {
432 $this->resourceCache[$resource] = $fullPath;
439 "Could not find resource '$resource' in any resource paths." 440 .
"(searched: " . join(
", ", $this->searchPaths).
")" 454 return end($allPaths) ?: null;
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static translateErrorCode($error_code)
Translate ErrorException code into the represented constant.
Exposes useful tools for working with/in templates.
Whoops - php errors for cool kids.
addResourcePath($path)
Adds a path to the list of paths to be searched for resources.
addEditor($identifier, $resolver)
handleUnconditionally($value=null)
Allows to disable all attempts to dynamically decide whether to handle or return prematurely.
getDataTables($label=null)
Returns all the extra data tables registered with this handler.
addDataTableCallback($label, $callback)
Lazily adds an entry to the list of tables displayed in the table.
addDataTable($label, array $data)
Adds an entry to the list of tables displayed in the template.
const DONE
Return constants that can be returned from Handler::handle to message the handler walker...
getResource($resource)
Finds a resource, by its relative path, in all available search paths.
getEditorHref($filePath, $line)
Given a string file path, and an integer file line, executes the editor resolver and returns...
Abstract implementation of a Handler.
addCustomCss($name)
Adds a custom css file to be loaded.
__construct()
Constructor.
setResourcesPath($resourcesPath)