Exemplo n.º 1
0
 /**
  * Creates a named config storage object, adds it to the storages list and returns a reference to it.
  *
  * @param string $storage_name
  *            Name of storage to create
  *
  * @throws ConfigException
  *
  * @return ConfigStorage
  */
 public function &createStorage(string $storage_name) : ConfigStorage
 {
     if (isset($this->storage[$storage_name])) {
         return $this->getStorage($storage_name);
     }
     $storage = new ConfigStorage();
     $storage->setName($storage_name);
     $this->storage[$storage_name] = $storage;
     return $storage;
 }
Exemplo n.º 2
0
 /**
  * Initializes the app config data and flags by getting data from Cfg and adding
  * config defaultvalues from app $cfg on demand.
  */
 protected function initConfig()
 {
     if (isset($this->settings) || $this->settings->exists('config')) {
         $this->config->setDefinition($this->settings->get('config'));
     }
 }