本文整理汇总了PHP中Debug::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::instance方法的具体用法?PHP Debug::instance怎么用?PHP Debug::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::instance方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
public static function instance()
{
if (null === Debug::$instance) {
Debug::$instance = new Debug();
}
return Debug::$instance;
}
示例2: getInstance
public static function getInstance()
{
if (!self::$instance instanceof self) {
self::$instance = new self();
}
return self::$instance;
}
示例3: getInstance
static function getInstance()
{
if (self::$instance == NULL) {
self::$instance = new Debug();
}
return self::$instance;
}
示例4: singleton
public static function singleton()
{
if (!isset(self::$instance)) {
$c = __CLASS__;
self::$instance = new $c();
}
return self::$instance;
}
示例5: Init
public static function Init($debug_type = "")
{
self::$instance = new Debug();
if (empty($debug_type)) {
$debug_type = self::$last_debug_type;
}
if (stristr($debug_type, "file")) {
self::$instance->log_file = true;
} elseif (stristr($debug_type, "screen")) {
self::$instance->log_screen = true;
}
self::$last_debug_type = $debug_type;
}
示例6: debug
/**
* 获取debug对象
* 可安全用于生产环境,在生产环境下将忽略所有debug信息
* @return Debug
*/
public static function debug()
{
static $debug = null;
if (null === $debug) {
if (!IS_CLI && (IS_DEBUG || false !== strpos($_SERVER["HTTP_USER_AGENT"], 'FirePHP') || isset($_SERVER["HTTP_X_FIREPHP_VERSION"])) && class_exists('Debug', true)) {
$debug = Debug::instance();
} else {
$debug = new __NoDebug();
}
}
return $debug;
}
示例7: accumulatorStop
function accumulatorStop($key)
{
if (!Debug :: isDebugEnabled())
return;
$debug =& Debug :: instance();
$stop_time = $debug->_timeToFloat(microtime());
if (! array_key_exists($key, $debug->time_accumulator_list))
{
Debug :: writeWarning('Accumulator $key does not exists, run Debug :: accumulator_start first', 'Debug :: accumulator_stop');
return;
}
$accumulator = &$debug->time_accumulator_list[$key];
$diffTime = $stop_time - $accumulator['temp_time'];
$accumulator['time'] = $accumulator['time'] + $diffTime;
++$accumulator['count'];
}
示例8: i
public static function i()
{
//singleton
if (!self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
示例9: GI
private static function GI()
{
if (self::$instance === null) {
self::$instance = new static();
}
return self::$instance;
}
示例10: debug
/**
* 返回DEBUG对象
*
* @return \Debug
*/
public static function debug()
{
static $debug = null;
if (null === $debug) {
if (!\IS_CLI && \IS_DEBUG && false !== \strpos($_SERVER["HTTP_USER_AGENT"], 'FirePHP') && \class_exists('\\Debug', true)) {
$debug = \Debug::instance();
} else {
$debug = new _NoDebug();
}
}
return $debug;
}
示例11: debug
/**
* 获取debug对象
* 可安全用于生产环境,在生产环境下将忽略所有debug信息
* @return Debug
*/
public static function debug()
{
static $debug = null;
if (null === $debug) {
if (!IS_CLI && IS_DEBUG && class_exists('Debug', true)) {
$debug = Debug::instance();
} else {
$debug = new MyQEE_Core_NoDebug();
}
}
return $debug;
}
示例12: instance
static public function instance()
{
if (!self :: $instance)
{
if(class_exists('DebugMock'))
self :: $instance = new DebugMock();
else
self :: $instance = new Debug();
}
return self :: $instance;
}
示例13: debugNav
public function debugNav()
{
$admin = Debug::instance();
$admin->debugNav($this);
}