当前位置: 首页>>代码示例>>PHP>>正文


PHP Debugger::source方法代码示例

本文整理汇总了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>\' : \'\')
					. \'&nbsp; <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'));
    }
开发者ID:radekdostal,项目名称:dibi,代码行数:37,代码来源:Debugger.php

示例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)
					. \'&nbsp; <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]) . \'&nbsp; <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()
    }
开发者ID:riskatlas,项目名称:micka,代码行数:55,代码来源:Debugger.php


注:本文中的Debugger::source方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。