コード例 #1
0
ファイル: Debug.php プロジェクト: jaroslavlibal/MDW
 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: ' . $_SERVER['argv'][0];
     } else {
         self::$firebugDetected = isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'FirePHP/');
         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'];
         }
     }
     $tab = array(__CLASS__, 'renderTab');
     $panel = array(__CLASS__, 'renderPanel');
     self::addPanel(new DebugPanel('time', $tab, $panel));
     self::addPanel(new DebugPanel('memory', $tab, $panel));
     self::addPanel(new DebugPanel('errors', $tab, $panel));
     self::addPanel(new DebugPanel('dumps', $tab, $panel));
 }