src/Cache/Cache.php
public function setCacheStore($store = "Default"){
        if($store == "Default"){
            $store= self::$config['defaultStore'];            
        }
        if($store == 'none'){
            $this->store= new CacheNone();
        }else{
            $config= self::$config['stores'][$store];
            switch ($config['driver']) {
                case 'file':
                    $this->store= new CacheFileSystem($config['folder']);
                    break;
                case 'database':
                    $this->store= new CacheDataBase($config['connection'], $config['table']);
                    break;
                case 'apc':
                    $this->store= new CacheApc();
                    break;
                case 'memcached':
                    $persistenceId= isset($config['persistenceId']) ? $config['persistenceId'] : NULL;
                    $this->store= new CacheMemCached($config["servers"], $persistenceId);
                    break;
                case 'redis':
                    $this->store= new CacheRedis($config['schema'], $config['host'], $config['port']);
                    break;
                default:
                    \Enola\Error::general_error("Cache Configuration", "Driver specified unsupported");
                    break;
            }
        }
    }
public function setCacheStore($store = "Default"){
        if($store == "Default"){
            $store= self::$config['defaultStore'];            
        }
        if($store == 'none'){
            $this->store= new CacheNone();
        }else{
            $config= self::$config['stores'][$store];
            switch ($config['driver']) {
                case 'file':
                    $this->store= new CacheFileSystem($config['folder']);
                    break;
                case 'database':
                    $this->store= new CacheDataBase($config['connection'], $config['table']);
                    break;
                case 'apc':
                    $this->store= new CacheApc();
                    break;
                case 'memcached':
                    $persistenceId= isset($config['persistenceId']) ? $config['persistenceId'] : NULL;
                    $this->store= new CacheMemCached($config["servers"], $persistenceId);
                    break;
                case 'redis':
                    $this->store= new CacheRedis($config['schema'], $config['host'], $config['port']);
                    break;
                default:
                    \Enola\Error::general_error("Cache Configuration", "Driver specified unsupported");
                    break;
            }
        }
    }
public function setCacheStore ( $ store = "Default" ) { if ( $ store == "Default" ) { $ store = self :: $ config [ 'defaultStore' ] ; } if ( $ store == 'none' ) { $ this -> store = new CacheNone ( ) ; } else { $ config = self :: $ config [ 'stores' ] [ $ store ] ; switch ( $ config [ 'driver' ] ) { case 'file' : $ this -> store = new CacheFileSystem ( $ config [ 'folder' ] ) ; break ; case 'database' : $ this -> store = new CacheDataBase ( $ config [ 'connection' ] , $ config [ 'table' ] ) ; break ; case 'apc' : $ this -> store = new CacheApc ( ) ; break ; case 'memcached' : $ persistenceId = isset ( $ config [ 'persistenceId' ] ) ? $ config [ 'persistenceId' ] : NULL ; $ this -> store = new CacheMemCached ( $ config [ "servers" ] , $ persistenceId ) ; break ; case 'redis' : $ this -> store = new CacheRedis ( $ config [ 'schema' ] , $ config [ 'host' ] , $ config [ 'port' ] ) ; break ; default : \ Enola \ Error :: general_error ( "Cache Configuration" , "Driver specified unsupported" ) ; break ; } } }
Setea el driver indicado
@param string $store
Setea el driver indicado