Пример #1
0
 /**
  * 
  * 获取单例
  * 
  * @return Yun_Conf
  */
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new Yun_Conf();
     }
     return self::$instance;
 }
Пример #2
0
 private function __construct()
 {
     $conf = Yun_Conf::getInstance();
     $log_file_path = $conf->get(self::CONF_KEY);
     if (NULL === $log_file_path) {
         $log_file_path = "php://stderr";
     }
     $this->handler[self::DEFAULT_HANDLER_ID] = new Yun_Log_File(self::DEFAULT_HANDLER_ID, $log_file_path);
 }
Пример #3
0
 /**
  * 初始化main_conf
  * 如果没有设置,则读取默认设置
  */
 protected function initConf()
 {
     if (null === $this->main_conf) {
         $conf = Yun_Conf::getInstance()->get(self::CONF_KEY);
         if (!$conf instanceof Yun_Db_Conf_Interface) {
             $error_msg = 'Yun_Conf::get("yun_db_conf")\'s value must be implement Yun_Db_Conf_Interface.';
             trigger_error($error_msg, E_USER_ERROR);
         }
         $this->main_conf = $conf;
     }
 }