public static function _init() { self::$time = microtime(TRUE); self::$consoleMode = PHP_SAPI === 'cli'; self::$productionMode = self::DETECT; 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'; self::addPanel(new DebugPanel('time', array(__CLASS__, 'getDefaultPanel'))); self::addPanel(new DebugPanel('memory', array(__CLASS__, 'getDefaultPanel'))); self::addPanel(new DebugPanel('errors', array(__CLASS__, 'getDefaultPanel'))); self::addPanel(new DebugPanel('dumps', array(__CLASS__, 'getDefaultPanel'))); register_shutdown_function(array(__CLASS__, '_shutdownHandler')); }
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_X_FIRELOGGER']); 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)); }
/** * Static class constructor. */ public static function init() { self::$time = microtime(TRUE); self::$consoleMode = PHP_SAPI === 'cli'; self::$productionMode = self::DETECT; 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'; }
<?php require_once '../../Nette/loader.php'; /*use Nette\Debug;*/ Debug::$time = 1201042800; $_SERVER = array_intersect_key($_SERVER, array('PHP_SELF' => 1, 'SCRIPT_NAME' => 1, 'SERVER_ADDR' => 1, 'SERVER_SOFTWARE' => 1, 'HTTP_HOST' => 1, 'DOCUMENT_ROOT' => 1)); Debug::$consoleMode = FALSE; Debug::enable(); //Debug::$logDir = 'compress.zlib://' . dirname(__FILE__) . '/log'; define('MY_CONST', 123); function first($arg1, $arg2) { second(TRUE, FALSE); } function second($arg1, $arg2) { third(array(1, 2, 3)); } function third($arg1) { throw new Exception('The my exception', 123); } first(10, 'any string');
static function _init() { self::$time = microtime(TRUE); self::$consoleMode = PHP_SAPI === 'cli'; self::$productionMode = self::DETECT; 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'; register_shutdown_function(array(__CLASS__, '_shutdownHandler')); }
<?php require_once '../../Nette/loader.php'; /*use Nette\Debug;*/ Debug::$time = 1201042800; $_SERVER = array_intersect_key($_SERVER, array('PHP_SELF' => 1, 'SCRIPT_NAME' => 1, 'SERVER_ADDR' => 1, 'SERVER_SOFTWARE' => 1, 'HTTP_HOST' => 1, 'DOCUMENT_ROOT' => 1)); Debug::$consoleMode = TRUE; Debug::enable(); function first($arg1, $arg2) { second(TRUE, FALSE); } function second($arg1, $arg2) { third(array(1, 2, 3)); } function third($arg1) { missing_funcion(); } first(10, 'any string');
static function _init() { self::$time = microtime(TRUE); self::$consoleMode = PHP_SAPI === 'cli'; self::$productionMode = self::DETECT; 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'; $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)); }
static function _init() { self::$time = microtime(TRUE); self::$consoleMode = PHP_SAPI === 'cli'; self::$productionMode = self::DETECT; 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::$uri = (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)); }