protected function _setupCacheProvider()
	{
		//  If something should be cached
		if ($this->isSettingSet(self::SET_CACHE_PROVIDER) == false
			|| ($this->getSetting(self::SET_CACHE_PROVIDER) == self::CACHE_PROVIDER_FILE && $this->isSettingSet(self::SET_CACHE_PROVIDER_PARAMS) == false))
		{
			//  Set default cache provider if not already set
			$this->setSettings([
				self::SET_CACHE_PROVIDER        => self::CACHE_PROVIDER_FILE,
				self::SET_CACHE_PROVIDER_PARAMS => [
					__DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR,
				],
			]);
		}

		try
		{
			//  Creates reflection of specified cache provider (can be user-made)
			$cacheProvider = new \ReflectionClass($this->getSetting(self::SET_CACHE_PROVIDER));
			//  Checks if this cache provider implements required interface
			if ($cacheProvider->implementsInterface(ICacheProvider::class) == false)
				throw new SettingsException("Provided CacheProvider does not implement ICacheProvider interface.");

			//  Gets default parameters
			$params = $this->getSetting(self::SET_CACHE_PROVIDER_PARAMS, []);
			//  and creates new instance of this cache provider
			$this->cache = $cacheProvider->newInstanceArgs($params);
		}
		catch (\ReflectionException $ex)
		{
			//  probably problem when instantiating the class
			throw new SettingsException("Failed to initialize CacheProvider class: " . $ex->getMessage() . ".", 0, $ex);
		}
		catch (\Exception $ex)
		{
			//  something went wrong when initializing the class - invalid settings, etc.
			throw new SettingsException("CacheProvider class failed to be initialized: " . $ex->getMessage() . ".", 0, $ex);
		}

		//  Loads existing cache or creates new storages
		$this->loadCache();
	}
protected function _setupCacheProvider()
	{
		//  If something should be cached
		if ($this->isSettingSet(self::SET_CACHE_PROVIDER) == false
			|| ($this->getSetting(self::SET_CACHE_PROVIDER) == self::CACHE_PROVIDER_FILE && $this->isSettingSet(self::SET_CACHE_PROVIDER_PARAMS) == false))
		{
			//  Set default cache provider if not already set
			$this->setSettings([
				self::SET_CACHE_PROVIDER        => self::CACHE_PROVIDER_FILE,
				self::SET_CACHE_PROVIDER_PARAMS => [
					__DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR,
				],
			]);
		}

		try
		{
			//  Creates reflection of specified cache provider (can be user-made)
			$cacheProvider = new \ReflectionClass($this->getSetting(self::SET_CACHE_PROVIDER));
			//  Checks if this cache provider implements required interface
			if ($cacheProvider->implementsInterface(ICacheProvider::class) == false)
				throw new SettingsException("Provided CacheProvider does not implement ICacheProvider interface.");

			//  Gets default parameters
			$params = $this->getSetting(self::SET_CACHE_PROVIDER_PARAMS, []);
			//  and creates new instance of this cache provider
			$this->cache = $cacheProvider->newInstanceArgs($params);
		}
		catch (\ReflectionException $ex)
		{
			//  probably problem when instantiating the class
			throw new SettingsException("Failed to initialize CacheProvider class: " . $ex->getMessage() . ".", 0, $ex);
		}
		catch (\Exception $ex)
		{
			//  something went wrong when initializing the class - invalid settings, etc.
			throw new SettingsException("CacheProvider class failed to be initialized: " . $ex->getMessage() . ".", 0, $ex);
		}

		//  Loads existing cache or creates new storages
		$this->loadCache();
	}
protected function _setupCacheProvider ( ) { //  If something should be cached if ( $ this -> isSettingSet ( self :: SET_CACHE_PROVIDER ) == false || ( $ this -> getSetting ( self :: SET_CACHE_PROVIDER ) == self :: CACHE_PROVIDER_FILE && $ this -> isSettingSet ( self :: SET_CACHE_PROVIDER_PARAMS ) == false ) ) { //  Set default cache provider if not already set $ this -> setSettings ( [ self :: SET_CACHE_PROVIDER => self :: CACHE_PROVIDER_FILE , self :: SET_CACHE_PROVIDER_PARAMS => [ __DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR , ] , ] ) ; } try { //  Creates reflection of specified cache provider (can be user-made) $ cacheProvider = new \ ReflectionClass ( $ this -> getSetting ( self :: SET_CACHE_PROVIDER ) ) ; //  Checks if this cache provider implements required interface if ( $ cacheProvider -> implementsInterface ( ICacheProvider :: class ) == false ) throw new SettingsException ( "Provided CacheProvider does not implement ICacheProvider interface." ) ; //  Gets default parameters $ params = $ this -> getSetting ( self :: SET_CACHE_PROVIDER_PARAMS , [ ] ) ; //  and creates new instance of this cache provider $ this -> cache = $ cacheProvider -> newInstanceArgs ( $ params ) ; } catch ( \ ReflectionException $ ex ) { //  probably problem when instantiating the class throw new SettingsException ( "Failed to initialize CacheProvider class: " . $ ex -> getMessage ( ) . "." , 0 , $ ex ) ; } catch ( \ Exception $ ex ) { //  something went wrong when initializing the class - invalid settings, etc. throw new SettingsException ( "CacheProvider class failed to be initialized: " . $ ex -> getMessage ( ) . "." , 0 , $ ex ) ; } //  Loads existing cache or creates new storages $ this -> loadCache ( ) ; }
Initializes library cache provider.

@throws SettingsException
Initializes library cache provider .