Exemplo n.º 1
0
 /**
  * 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);
 }