本文整理汇总了PHP中Debug::time方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::time方法的具体用法?PHP Debug::time怎么用?PHP Debug::time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::time方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _init
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'));
}
示例2: _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: ' . $_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));
}
示例3: init
/**
* 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';
}
示例4: replaceObjects
foreach (str_split($payload, 4990) as $s) {
$num = ++$counter;
header("X-Wf-nette-{$index}-1-n{$num}: |{$s}|\\");
}
header("X-Wf-nette-{$index}-1-n{$num}: |{$s}|");
return TRUE;
}
/**
* fireLog helper
* @param mixed
* @return mixed
*/
private static function replaceObjects($val)
{
if (is_object($val)) {
return 'object ' . get_class($val) . '';
} elseif (is_array($val)) {
foreach ($val as $k => $v) {
unset($val[$k]);
$val[$k] = self::replaceObjects($v);
}
}
return $val;
}
}
/**
* Static class constructor.
*/
Debug::$html = PHP_SAPI !== 'cli';
Debug::$time = microtime(TRUE);
// if (!function_exists('dump')) { function dump($var, $return = FALSE) { /*Nette\*/Debug::dump($var, $return); } }
示例5: array
<pre>
<?php
require_once '../../Nette/loader.php';
/*use Nette\Debug;*/
/*use Nette\Environment;*/
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));
echo "Debug::\$productionMode\n";
Debug::dump(Debug::$productionMode);
echo "setting production environment...\n";
Environment::setMode('production', TRUE);
Debug::enable();
echo "Debug::\$productionMode\n";
echo Debug::dump(Debug::$productionMode, TRUE);
示例6: microtime
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'));
}
示例7: microtime
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));
}
示例8: microtime
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));
}
示例9: testMailer
<?php
require_once '../../Nette/loader.php';
/*use Nette\Debug;*/
Debug::$time = 1201042800.1875;
Debug::$mailer = 'testMailer';
$_SERVER = array_intersect_key($_SERVER, array('PHP_SELF' => 1, 'SCRIPT_NAME' => 1, 'SERVER_ADDR' => 1, 'SERVER_SOFTWARE' => 1, 'HTTP_HOST' => 1, 'DOCUMENT_ROOT' => 1));
$_SERVER['HTTP_HOST'] = 'nettephp.com';
function testMailer($message)
{
echo "\nSending mail with message '{$message}'\n";
echo "\nFiles:\n";
global $errorLog;
foreach (glob(dirname($errorLog) . '/*') as $file) {
echo "{$file}:\n";
echo "----------------\n";
echo file_get_contents($file);
echo "\n----------------\n\n";
}
}
$errorLog = dirname(__FILE__) . '/log/php_error.log';
foreach (glob(dirname($errorLog) . '/*') as $file) {
unlink($file);
}
// delete all files
Debug::enable(Debug::PRODUCTION, $errorLog, 'admin@example.com');
function first($arg1, $arg2)
{
second(TRUE, FALSE);
}
function second($arg1, $arg2)