Horde_Cache_Sql_Base::_getCache PHP Method

_getCache() protected method

protected _getCache ( $params = [] )
    protected function _getCache($params = array())
    {
        $logger = new Horde_Log_Logger(new Horde_Log_Handler_Cli());
        //$this->db->setLogger($logger);
        $dir = __DIR__ . '/../../../../migration/Horde/Cache';
        if (!is_dir($dir)) {
            error_reporting(E_ALL & ~E_DEPRECATED);
            $dir = PEAR_Config::singleton()->get('data_dir', null, 'pear.horde.org') . '/Horde_Cache/migration';
            error_reporting(E_ALL | E_STRICT);
        }
        $this->migrator = new Horde_Db_Migration_Migrator($this->db, null, array('migrationsPath' => $dir, 'schemaTableName' => 'horde_cache_schema_info'));
        $this->migrator->up();
        return new Horde_Cache(new Horde_Cache_Storage_File(array_merge(array('db' => $this->db), $params)));
    }

Usage Example

Esempio n. 1
0
 protected function _getCache($params = array())
 {
     $factory_db = new Horde_Test_Factory_Db();
     try {
         $this->db = $factory_db->create();
     } catch (Horde_Test_Exception $e) {
         $this->reason = 'Sqlite not available';
         return;
     }
     return parent::_getCache($params);
 }
All Usage Examples Of Horde_Cache_Sql_Base::_getCache
Horde_Cache_Sql_Base