本文整理汇总了PHP中Conf::getConf方法的典型用法代码示例。如果您正苦于以下问题:PHP Conf::getConf方法的具体用法?PHP Conf::getConf怎么用?PHP Conf::getConf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conf
的用法示例。
在下文中一共展示了Conf::getConf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($item)
{
if (empty($item)) {
return $item;
}
$dbConf = Conf::getConf('/db/mysql/' . $item);
$this->log = Log::getInstance('mysql');
$this->connect($dbConf["hostname"], $dbConf["username"], $dbConf["password"], $dbConf["database"], $dbConf["pconnect"]);
}
示例2: getInstance
public static function getInstance($name = '')
{
if (!$name) {
$name = APP_NAME;
}
if (!self::$logId) {
self::getLogId();
}
if (!empty(self::$instance[$name])) {
return self::$instance[$name];
}
$logConf = Conf::getConf("/log/{$name}");
if (!isset($logConf['logLevel']) || !$logConf['logLevel']) {
$logConf['logLevel'] = Conf::getConf("/log/logLevel");
}
if (!isset($logConf['logLevel']) || !$logConf['logLevel']) {
$logConf['logLevel'] = self::LOG_LEVEL_NOTICE;
}
if (!isset($logConf['file']) || !$logConf['file']) {
$logConf['file'] = LOG_PATH . '/' . $name . '.log';
}
self::$instance[$name] = new Log($logConf);
return self::$instance[$name];
}
示例3: Sphinx
function Sphinx($name)
{
$sphinxConf = Conf::getConf('/sphinx/' . $name);
$log = Log::getInstance('sphinx');
if (!$sphinxConf) {
$log->warning('Sphinx not in conf, Name:' . $name);
return false;
}
if (!$sphinxConf['host'] || !$sphinxConf['port']) {
$log->warning('Sphinx Conf must have host and port');
return false;
}
$this->_host = $sphinxConf['host'];
$this->_port = $sphinxConf['port'];
$this->_path = false;
$this->_socket = false;
// per-query settings
$this->_offset = 0;
$this->_limit = 20;
$this->_mode = SPH_MATCH_ALL;
$this->_weights = array();
$this->_sort = SPH_SORT_RELEVANCE;
$this->_sortby = "";
$this->_min_id = 0;
$this->_max_id = 0;
$this->_filters = array();
$this->_groupby = "";
$this->_groupfunc = SPH_GROUPBY_DAY;
$this->_groupsort = "@group desc";
$this->_groupdistinct = "";
$this->_maxmatches = 1000;
$this->_cutoff = 0;
$this->_retrycount = 0;
$this->_retrydelay = 0;
$this->_anchor = array();
$this->_indexweights = array();
$this->_ranker = SPH_RANK_PROXIMITY_BM25;
$this->_maxquerytime = 0;
$this->_fieldweights = array();
$this->_overrides = array();
$this->_select = "*";
$this->_error = "";
// per-reply fields (for single-query case)
$this->_warning = "";
$this->_connerror = false;
$this->_reqs = array();
// requests storage (for multi-query case)
$this->_mbenc = "";
$this->_arrayresult = false;
$this->_timeout = 0;
}