本文整理汇总了PHP中Debugger::source方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::source方法的具体用法?PHP Debugger::source怎么用?PHP Debugger::source使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debugger
的用法示例。
在下文中一共展示了Debugger::source方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _init
public static function _init()
{
self::$time = microtime(TRUE);
self::$consoleMode = PHP_SAPI === 'cli';
self::$productionMode = self::DETECT;
if (self::$consoleMode) {
self::$source = empty($_SERVER['argv']) ? 'cli' : 'cli: ' . implode(' ', $_SERVER['argv']);
} else {
self::$ajaxDetected = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest';
if (isset($_SERVER['REQUEST_URI'])) {
self::$source = (isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'off') ? 'https://' : 'http://') . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '')) . $_SERVER['REQUEST_URI'];
}
}
self::$logger = new Logger();
self::$logger->directory =& self::$logDirectory;
self::$logger->email =& self::$email;
self::$logger->mailer =& self::$mailer;
Logger::$emailSnooze =& self::$emailSnooze;
self::$fireLogger = new FireLogger();
self::$blueScreen = new DebugBlueScreen();
self::$blueScreen->addPanel(create_function('$e', '
if ($e instanceof TemplateException) {
$link = DebugHelpers::editorLink($e->sourceFile, $e->sourceLine);
return array(
\'tab\' => \'Template\',
\'panel\' => \'<p><b>File:</b> \' . ($link ? \'<a href="\' . htmlspecialchars($link) . \'">\' : \'\') . htmlspecialchars($e->sourceFile) . ($link ? \'</a>\' : \'\')
. \' <b>Line:</b> \' . ($e->sourceLine ? $e->sourceLine : \'n/a\') . \'</p>\'
. ($e->sourceLine ? \'<pre>\' . DebugBlueScreen::highlightFile($e->sourceFile, $e->sourceLine) . \'</pre>\' : \'\')
);
}
'));
self::$bar = new DebugBar();
self::$bar->addPanel(new DefaultBarPanel('time'));
self::$bar->addPanel(new DefaultBarPanel('memory'));
self::$bar->addPanel(self::$errorPanel = new DefaultBarPanel('errors'));
self::$bar->addPanel(self::$dumpPanel = new DefaultBarPanel('dumps'));
}
示例2: _init
/**
* Static class constructor.
* @internal
*/
public static function _init()
{
self::$time = isset($_SERVER['REQUEST_TIME_FLOAT']) ? $_SERVER['REQUEST_TIME_FLOAT'] : microtime(TRUE);
self::$consoleMode = PHP_SAPI === 'cli';
self::$productionMode = self::DETECT;
if (self::$consoleMode) {
self::$source = empty($_SERVER['argv']) ? 'cli' : 'cli: ' . implode(' ', $_SERVER['argv']);
} else {
self::$ajaxDetected = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest';
if (isset($_SERVER['REQUEST_URI'])) {
self::$source = (isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'off') ? 'https://' : 'http://') . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '')) . $_SERVER['REQUEST_URI'];
}
}
self::$logger = new Logger();
self::$logDirectory =& self::$logger->directory;
self::$email =& self::$logger->email;
self::$mailer =& self::$logger->mailer;
self::$emailSnooze =& Logger::$emailSnooze;
self::$fireLogger = new FireLogger();
self::$blueScreen = new DebugBlueScreen();
self::$blueScreen->addPanel(create_function('$e', '
if ($e instanceof TemplateException) {
return array(
\'tab\' => \'Template\',
\'panel\' => \'<p><b>File:</b> \' . DebugHelpers::editorLink($e->sourceFile, $e->sourceLine)
. \' <b>Line:</b> \' . ($e->sourceLine ? $e->sourceLine : \'n/a\') . \'</p>\'
. ($e->sourceLine ? DebugBlueScreen::highlightFile($e->sourceFile, $e->sourceLine) : \'\')
);
} elseif ($e instanceof NeonException && preg_match(\'#line (\\d+)#\', $e->getMessage(), $m)) {
if ($item = DebugHelpers::findTrace($e->getTrace(), \'ConfigNeonAdapter::load\')) {
return array(
\'tab\' => \'NEON\',
\'panel\' => \'<p><b>File:</b> \' . DebugHelpers::editorLink($item[\'args\'][0], $m[1]) . \' <b>Line:</b> \' . $m[1] . \'</p>\'
. DebugBlueScreen::highlightFile($item[\'args\'][0], $m[1])
);
} elseif ($item = DebugHelpers::findTrace($e->getTrace(), \'Neon::decode\')) {
return array(
\'tab\' => \'NEON\',
\'panel\' => DebugBlueScreen::highlightPhp($item[\'args\'][0], $m[1])
);
}
}
'));
self::$bar = new DebugBar();
self::$bar->addPanel(new DefaultBarPanel('time'));
self::$bar->addPanel(new DefaultBarPanel('memory'));
self::$bar->addPanel(self::$errorPanel = new DefaultBarPanel('errors'));
// filled by _errorHandler()
self::$bar->addPanel(self::$dumpPanel = new DefaultBarPanel('dumps'));
// filled by barDump()
}