本文整理匯總了PHP中Debugger::ajaxDetected方法的典型用法代碼示例。如果您正苦於以下問題:PHP Debugger::ajaxDetected方法的具體用法?PHP Debugger::ajaxDetected怎麽用?PHP Debugger::ajaxDetected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Debugger
的用法示例。
在下文中一共展示了Debugger::ajaxDetected方法的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()
}