Exemple #1
0
 public static function instance()
 {
     if (null === Debug::$instance) {
         Debug::$instance = new Debug();
     }
     return Debug::$instance;
 }
Exemple #2
0
 public static function getInstance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #3
0
 static function getInstance()
 {
     if (self::$instance == NULL) {
         self::$instance = new Debug();
     }
     return self::$instance;
 }
Exemple #4
0
 public static function singleton()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
Exemple #5
0
 public static function singleton()
 {
     if (!isset(self::$instance)) {
         // Você deve informar os dados para conexão com o banco de dados.
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
 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;
 }
Exemple #7
0
 /**
  * 获取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;
 }
  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'];
  }
Exemple #9
0
 public static function i()
 {
     //singleton
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #10
0
 private static function GI()
 {
     if (self::$instance === null) {
         self::$instance = new static();
     }
     return self::$instance;
 }
Exemple #11
0
 /**
  * 返回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;
 }
Exemple #12
0
 /**
  * 获取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;
 }
  static public function instance()
  {
    if (!self :: $instance)
    {
      if(class_exists('DebugMock'))
        self :: $instance = new DebugMock();
      else
        self :: $instance = new Debug();
    }

    return self :: $instance;
  }
Exemple #14
0
 public function debugNav()
 {
     $admin = Debug::instance();
     $admin->debugNav($this);
 }