Example #1
0
 /**
  * Carga una vez el motor de cache y la
  * configuración del cache.
  *
  * @return void
  */
 private function load()
 {
     // Verifico si el cache esta activo
     if (Settings::get('cacheEnabled')) {
         $this->cacheEnabled = true;
     }
     // Sigue cargando el motor de cache, solo su esta activo
     if ($this->cacheEnabled) {
         $cacheSettings = Settings::get('cache');
         // Se almacenan los ítems de configuración del cache
         $this->engine = $cacheSettings['engine'];
         $this->location = $cacheSettings['location'];
         $this->timeout = $cacheSettings['timeout'];
         $this->maxEntries = $cacheSettings['maxEntries'];
         // Se crea la instancia del motor según la configuración
         if ($this->engine === 'filecache') {
             $this->cacheEngine = new \ForeverPHP\Cache\FileCache($this->location);
         }
     }
 }