本文整理汇总了PHP中Q_Config::tree方法的典型用法代码示例。如果您正苦于以下问题:PHP Q_Config::tree方法的具体用法?PHP Q_Config::tree怎么用?PHP Q_Config::tree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q_Config
的用法示例。
在下文中一共展示了Q_Config::tree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: expect
/**
* Gets the value of a configuration field. If it is null or not set,
* throws an exception. Otherwise, it is guaranteed to return a non-null value.
* @method expect
* @static
* @param {string} $key1 The name of the first key in the configuration path
* @param {string} $key2 Optional. The name of the second key in the configuration path.
* You can actually pass as many keys as you need,
* delving deeper and deeper into the configuration structure.
* All but the second-to-last parameter are interpreted as keys.
* @return {mixed} Only returns non-null values
* @throws {Q_Exception_MissingConfig} May throw an exception if the config field is missing.
*/
static function expect($key1)
{
$args = func_get_args();
if (!isset(self::$tree)) {
self::$tree = new Q_Tree();
}
return call_user_func_array(array(self::$tree, __FUNCTION__), $args);
}