Requests a config storage by it's name and returns (if exists) a reference to it

@param string $storage_name
Name of config storage

@return ConfigStorage
343600
public function &getStorage(string $storage_name): ConfigStorage
    {
        if (!isset($this->storage[$storage_name])) {
            Throw new ConfigException(sprintf('A config storage with name "%s" does not exists.', $storage_name));
        }

        return $this->storage[$storage_name];
    }
668290
protected function findSelectedStorageFactoryNameInStorageConfig($storageConfig)
    {
        foreach ($storageConfig as $name => $value) {
            if (isset($this->storagesFactories[$name])) {
                return $name;
            }
        }
    }
136457
function getStorageInstance(storage, config) {
  if (!(storage in protos.storages)) throw new Error(util.format("The '%s' storage is not loaded. Load it with app.loadStorages('%s')", storage, storage));
  return new protos.storages[storage](config || {});
}
742524
private function ensureStorage()
    {
        if (!isset($this->storage)) {
            $this->storage = $this->getCache()->get($this->cacheKey);

            if ($this->storage === false) {
                $this->storage = $this->getSettingsStorage()->getBounded($this->settingsStorageKey);
                $this->cache();
            }
        }

        return $this->storage;
    }
7463
public function saveCache(string $cache_name = null)
    {
        $cache_dir = $this->cache_path;
        $cnt = 0;
        foreach ($this->repository as $name => &$cache)
        {
            if ($cache_name !== null && $name !== $cache_name)
                continue;

            if (empty($cache['_changed']))
                continue;
            
            ++$cnt;
            unset($cache['_changed']);
            $cache_file = $cache_dir . '/' . $name . '.cache';
            file_put_contents($cache_file, serialize($cache));
            Hook::execute('Wedeto.IO.FileCreated', ['path' => $cache_file]);
        }
        return $cnt;
    }
1070439
public function get($uri, $storage, $name = null){
        return $this->add($uri, $storage, $name, 'GET');
    }
271669
public static function get_config($key = null, $connection_name = self::DEFAULT_CONNECTION) {
            if ($key) {
                return self::$_config[$connection_name][$key];
            } else {
                return self::$_config[$connection_name];
            }
        }
181981
public function setStorage($storage)
    {
        if (is_string($storage)) {
            $storage = $this->getStoragePlugins()->get($storage);
        } elseif (is_array($storage)) {
            if (!isset($storage['name'])) {
                throw new \Exception('Invalid Storage configuration: Name required.');
            }
            $storage = $this->getStoragePlugins()->get($storage['name'], $storage);
        }
        
        if (!$storage instanceof Storage\StorageInterface) {
            throw new \Exception('Storage must be instance of Spork\Mvc\Listener\Limit\Storage\StorageInterface');
        }
        
        $this->storage = $storage;
        return $this;
    }
1033027
def get_storage(store_type, data_type, name, args = {})
      full_name = "#{key}_#{name}"
      result = nil
      case store_type.to_sym
      when :redis
        result = get_redis_storage(data_type, full_name.to_s, args)
      when :local
        @_local_cache ||= {}
        unless @_local_cache[full_name.to_s]
          @_local_cache[full_name.to_s] = get_local_storage(data_type, full_name.to_s, args)
        end
        result = @_local_cache[full_name.to_s]
      else
        raise TypeError.new("Unsupported caching storage type encountered: #{store_type}")
      end
      unless full_name == "#{key}_registry_#{key}"
        registry[name.to_s] = data_type
      end
      result
    end
800884
public function getSupportedStorages(StorageType $storageType = null)
    {
        if ($storageType) {
            return [$storageType->getValue()];
        }

        return array_keys($this->storageTypeToInitializerMap);
    }
1044872
protected static function factory($storage)
    {
        $cache = Config::get('cache');

        switch ($storage) {
            case 'apc':
                return new CS\Apc($cache['key']);

            case 'file':
                return new CS\File($cache['storage_path']);

            case 'pdo':
                return new CS\Pdo(Pdo\Factory::get($cache['database']), $cache['key']);

            case 'memcached':
                return new CS\Memcached(Memcached::connection(), $cache['key']);

            case 'memory':
                return new CS\Memory();

            case 'redis':
                return new CS\Redis(Redis::database());

            case 'wincache':
                return new CS\WinCache($cache['key']);

            case 'dba':
                return new CS\Dba(Str::ensureTrailing('/', $cache['storage_path']) . $cache['key']);

            default:
                throw new \RuntimeException("Cache storage {$storage} is not supported.");
        }
    }
999054
public function setup( $repository_name = null ) {
		if ( empty( $this->config['repositories'] ) ) {
			Log::instance()->write( 'No repositories in configuration.', 1 );

			return false;
		}

		if ( empty( $repository_name ) ) {
			$repository_name = $this->getDefault();
		}

		if ( ! empty( $this->repositories[ $repository_name ] ) ) {
			return $this->repositories[ $repository_name ];
		}

		if ( empty( $this->config['repositories'][ $repository_name ] ) ) {
			Log::instance()->write( 'Repository not in configuration.', 1 );

			return false;
		}

		$repo_config = $this->config['repositories'][ $repository_name ];

		$repository = new Repository( $repository_name, $repo_config['access_key_id'], $repo_config['secret_access_key'], $repo_config['region'] );

		$this->repositories[ $repository_name ] = $repository;

		Log::instance()->write( 'Setup repository: ' . $repository_name );

		return $repository;
	}
491751
public function store($name = null)
    {
        if (is_null($name)) {
            $name = $this->defaultStore;
        }

        if (isset($this->caches[$name])) {
            return $this->caches[$name];
        }

        $config = config('cache.stores.' . $name);
        if ($config === null) {
            throw new InvalidArgumentException('Cache store "' . $name . '" is not defined.');
        }

        if (!isset($config['driver'])) {
            throw new InvalidArgumentException('Cache driver for store "' . $name . '" is not specified.');
        }

        switch ($config['driver']) {
            case 'APCu':
                $provider = new ApcuCache;
                break;
            case 'Array':
                $provider = new ArrayCache;
                break;
            case 'File':
                $provider = new FilesystemCache($config['path']);
                break;
            case 'Memcached':
                $memcached = new Memcached();
                $memcached->addServer($config['host'], $config['port'], $config['weight']);
                $provider = new MemcachedCache();
                $provider->setMemcached($memcached);
                break;
            case 'Redis':
                $redis = new Redis;
                $redis->connect($config['host'], $config['port'], $config['timeout']);
                $provider = new RedisCache;
                $provider->setRedis($redis);
                break;
            default:
                throw new InvalidArgumentException('Cache driver "' . $config['driver'] . '" is not supported.');
        }

        return $this->caches[$name] = new Cache($provider);
    }
65921
private static function createFromConfig($name): Storage\StorageInterface
    {
        $config = &self::$config['storage'][$name];
        $driver = &$config['driver'];
        $config = &$config['config'];

        return new self::$driver[$driver]($config);
    }
1096607
protected function getStorage($name)
    {
        $nameStorage = 'storage' . ucfirst($name);
        $data        = $this->{$nameStorage}();
        $defaults    = &$this->defaults();

        if (empty($data))
        {
            if (isset($defaults[$name]))
            {
                return $defaults[$name];
            }

            return null;
        }

        return $data;
    }
553432
protected function getYamlConfig($config_name)
    {
        if ($this->configStorage->exists($config_name)) {
            $configuration = $this->configStorage->read($config_name);
            $configurationEncoded = Yaml::encode($configuration);
        }

        return $configurationEncoded;
    }
1173845
public static function get($storage, $key)
    {
        $keys	= explode('.', $key);

        foreach($keys as $key)
            $storage	= &$storage[$key];

        return $storage;
    }