Example #1
0
 /**
  * 获取实例
  * @return SocketLog
  */
 private static function getInstance()
 {
     if (self::$instance === NULL) {
         //初始化链接,并对配置做相应操作
         self::$instance = new SocketLog();
         if (!self::$instance->Connect()) {
             self::$instance->config_del();
         }
     }
     return self::$instance;
 }
Example #2
0
 public static function setConfig($config)
 {
     $config = array_merge(self::$config, $config);
     self::$config = $config;
     if (self::check()) {
         self::getInstance();
         //强制初始化SocketLog实例
         if ($config['optimize']) {
             self::$start_time = microtime(true);
             self::$start_memory = memory_get_usage();
         }
         if ($config['error_handler']) {
             self::registerErrorHandler();
         }
     }
 }