本文整理汇总了PHP中Options::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::getInstance方法的具体用法?PHP Options::getInstance怎么用?PHP Options::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyOptions
protected static function applyOptions(Options $options = null)
{
if ($options !== null) {
self::$options = $options;
} else {
self::$options = Options::getInstance();
}
}
示例2: mongoInit
protected function mongoInit($require = true)
{
$this->mongo = Options::getInstance()->get('mongo');
if ($require && (empty($this->mongo) || !$this->mongo instanceof \MongoDB)) {
throw new Exception('Bad database options');
}
$this->collection = Options::getInstance()->get('mongo_collection', $this->collection);
}
示例3: __construct
public function __construct()
{
$this->mongoInit();
$this->cmd = Options::getInstance()->get('worker_cmd');
if (empty($this->cmd)) {
throw new Exception('Bad worker command options');
}
$this->workerMax = Options::getInstance()->get('worker_max_count', self::WORKERS_MAX);
$this->log = Options::getInstance()->get('log', function () {
/*do nothing*/
});
$this->timeout = intval(Options::getInstance()->get('hovering_timeout', self::HOVERING_TIMEOUT));
}
示例4: __construct
private function __construct()
{
$this->mongoInit();
$this->types = Options::getInstance()->get('job_types', []);
}