/** * Take a db hash and convert it into an array of files * * @see getFiles */ public static function getFilesByKey($key, $separator = ' ') { $base64 = false; // try get base64 from cache if (function_exists('apc_store') && ini_get('apc.enabled')) { $cache = new sfAPCCache(); $base64 = $cache->get($key); } if (!$base64) { $cache = new sfFileCache(array('cache_dir' => sfCombineUtility::getCacheDir())); $base64 = $cache->get($key); } // check db if (!$base64 && class_exists('sfCombine')) { $combine = Doctrine::getTable('sfCombine')->find($key); $base64 = $combine ? $combine->getFiles() : false; } return self::getFilesByBase64($base64, $separator); }
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require_once dirname(__FILE__) . '/../../bootstrap/unit.php'; $plan = 60; $t = new lime_test($plan, new lime_output_color()); try { new sfAPCCache(); } catch (sfInitializationException $e) { $t->skip($e->getMessage(), $plan); return; } if (!ini_get('apc.enable_cli')) { $t->skip('APC must be enable on CLI to run these tests', $plan); return; } require_once dirname(__FILE__) . '/sfCacheDriverTests.class.php'; // setup sfConfig::set('sf_logging_enabled', false); // ->initialize() $t->diag('->initialize()'); $cache = new sfAPCCache(); $cache->initialize(); sfCacheDriverTests::launch($t, $cache);
/** * will not unserialize result */ public function _get($key, $default = null) { return parent::get($key, $default); }