Beispiel #1
0
 /**
  * sweep/reset a namespaces or the global namespace
  *
  * @error 12406
  * @param null|string $ns expects the namespace to sweep
  * @return void
  */
 public static function sweep($ns = null)
 {
     if ($ns === null || $ns === 'global') {
         self::$_globalConfig = array();
         self::$_globalCache = array();
     } else {
         if (isset(self::$_instances[$ns])) {
             self::$_instances[$ns]->_config = array();
             self::$_instances[$ns]->_cache = array();
         }
     }
 }
Beispiel #2
0
 /**
  * shortcut method for getting config values set by xapp´s built in Xapp_Config class. this shortcut function
  * behaves like Xapp_Config::retrieve. a config (instance) must be loaded and initialized before using this shortcut
  * function and if not will return/throw default value.
  *
  * @see Xapp_Config::retrieve
  * @param string $ns expects the namespace
  * @param null|string $key expects the optional key to get value for
  * @param null|mixed|Exception $default expects optional default value if namespace/key is not found
  * @return null|mixed
  * @throws Exception
  */
 function xapp_config($ns, $key = null, $default = null)
 {
     if (xapped('Xapp_Config') && Xapp_Config::created()) {
         return Xapp_Config::retrieve($ns, $key, $default);
     } else {
         return xapp_default($default);
     }
 }