コード例 #1
0
 /**
  * 单例对象
  */
 public function getInstance($params = null)
 {
     if (!empty(self::$instance) && is_object(self::$instance)) {
         return self::$instance;
     }
     self::$instance = new self($params);
     return self::$instance;
 }
コード例 #2
0
ファイル: CLog.class.php プロジェクト: drehere/shenmegui
 /**
  * @return CLog
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         $intStartTime = defined('PROCESS_START_TIME') ? PROCESS_START_TIME : Volatile::microtime(true) * 1000;
         self::$instance = new CLog($GLOBALS['LOG'], $intStartTime);
     }
     return self::$instance;
 }