Пример #1
0
 public static function getGateway()
 {
     if (!self::$gateway) {
         self::$gateway = Redis::$server['webChat'];
     }
     return self::$gateway;
 }
Пример #2
0
 /**
  * Loads in a yaml config file, flattens it and stores the results
  * @param  string $resource - the name of the file resource to load
  */
 public function load($resource)
 {
     // Look for the cached config and try and use that
     if (file_exists($this->configPath)) {
         // The file has been generated and exists, so include it
         // It contains a class called ConfigStore
         require $this->configPath;
         // create the store object and copy the data from it
         $configStore = new ConfigStore();
         $this->all = $configStore->getSettings();
     } else {
         // Load the resource and set up the config
         $this->loadResource($resource);
         // write the config settings to the cache class?
         $this->writeCachedClass();
     }
 }
Пример #3
0
	protected function importConfigValues(SimpleXMLElement $sx) {
		if (isset($sx->config)) {
			$db = Loader::db();
			$configstore = new ConfigStore($db);
			foreach($sx->config->children() as $key) {
				$pkg = ContentImporter::getPackageObject($key['package']);
				if (is_object($pkg)) {
					$configstore->set($key->getName(), (string) $key, $pkg->getPackageID());
				} else {
					$configstore->set($key->getName(), (string) $key);
				}
			}
		}
	}
Пример #4
0
 public function getConfigStore()
 {
     if (!$this->configStore) {
         $args = array('site' => $this);
         $configStoreClass = Kurogo::arrayVal($this->initArgs, 'CONFIG_CLASS', 'ConfigFileStore');
         $this->configStore = ConfigStore::factory($configStoreClass, $args);
     }
     return $this->configStore;
 }