/** * @param string $zone * @param string $type main|query * @return array */ static function getConfig($zone = null, $type = "main") { $config = SConfig::getConfig(self::$_config_file, $zone); if (isset($config->{$type})) { return $config->{$type}; } elseif (isset($config->main)) { return $config->main; } return; }
/** * @param string $zone * @return array */ static function getConfig($zone = null, $type = "host") { $config = SConfig::getConfig(self::$_config, $zone); if (isset($config->{$type})) { return $config->{$type}; } elseif (isset($config->host)) { return $config->host; } return; }
static function getConfig($zone = null) { return SConfig::getConfig(self::$_config, $zone); }
/** * @return log */ public static function getInstance() { if (self::$instance === null) { $startTime = microtime(true) * 1000; $logConf = !empty($GLOBALS['LOG_CONF']) ? $GLOBALS['LOG_CONF'] : 'default'; $logConfig = SConfig::getConfig(ROOT_CONFIG . "/log.conf", $logConf); if (!empty($logConfig->filename)) { $logConfig->filename = sprintf($logConfig->filename, date('Ymd')); self::$instance = new SLog($logConfig, $startTime); } else { $stdClass = new stdClass(); $stdClass->appName = 'AllLog'; $stdClass->type = 'LOCAL_LOG'; $stdClass->level = '0x15'; $stdClass->path = '/tmp'; $stdClass->filename = 'All_log.' . date('Ymd'); self::$instance = new SLog($stdClass, $startTime); } } return self::$instance; }