public static function get($configName, $renewObject = false) {
		if (empty($configName) || !is_string($configName)) {
			throw new InvalidArgumentException('StorageManager::get() first arg must be a non empty string!');
		}

		$_this = static::getInstance();

		$isConfigured = true;

		if (!empty($_this->_adapterConfig[$configName])) {
			$adapter = $_this->_adapterConfig[$configName];
		} else {
			throw new RuntimeException(sprintf('Invalid Storage Adapter %s!', $configName));
		}

		if (!empty($_this->_adapterConfig[$configName]['object']) && $renewObject === false) {
			return $_this->_adapterConfig[$configName]['object'];
		}

		$engineObject = $_this->_factory($adapter);

		if ($isConfigured) {
			$_this->_adapterConfig[$configName]['object'] = &$engineObject;
		}

		return $engineObject;
	}
public static function get($configName, $renewObject = false) {
		if (empty($configName) || !is_string($configName)) {
			throw new InvalidArgumentException('StorageManager::get() first arg must be a non empty string!');
		}

		$_this = static::getInstance();

		$isConfigured = true;

		if (!empty($_this->_adapterConfig[$configName])) {
			$adapter = $_this->_adapterConfig[$configName];
		} else {
			throw new RuntimeException(sprintf('Invalid Storage Adapter %s!', $configName));
		}

		if (!empty($_this->_adapterConfig[$configName]['object']) && $renewObject === false) {
			return $_this->_adapterConfig[$configName]['object'];
		}

		$engineObject = $_this->_factory($adapter);

		if ($isConfigured) {
			$_this->_adapterConfig[$configName]['object'] = &$engineObject;
		}

		return $engineObject;
	}
public static function get ( $ configName , $ renewObject = false ) { if ( empty ( $ configName ) || ! is_string ( $ configName ) ) { throw new InvalidArgumentException ( 'StorageManager::get() first arg must be a non empty string!' ) ; } $ _this = static :: getInstance ( ) ; $ isConfigured = true ; if ( ! empty ( $ _this -> _adapterConfig [ $ configName ] ) ) { $ adapter = $ _this -> _adapterConfig [ $ configName ] ; } else { throw new RuntimeException ( sprintf ( 'Invalid Storage Adapter %s!' , $ configName ) ) ; } if ( ! empty ( $ _this -> _adapterConfig [ $ configName ] [ 'object' ] ) && $ renewObject === false ) { return $ _this -> _adapterConfig [ $ configName ] [ 'object' ] ; } $ engineObject = $ _this -> _factory ( $ adapter ) ; if ( $ isConfigured ) { $ _this -> _adapterConfig [ $ configName ] [ 'object' ] = & $ engineObject ; } return $ engineObject ; }
Gets a configured instance of a storage adapter.

@param string $configName string of adapter configuration or array of settings
@param bool|bool $renewObject Creates a new instance of the given adapter in the configuration
@throws \RuntimeException
@throws \InvalidArgumentException
@return \Gaufrette\Filesystem
Gets a configured instance of a storage adapter .