The Cache :: una clase para controlar nuestro Zend_Cache File

July 11, 2008 | In: enlaces, php, tutoriales, utilidades, zend framework

Akra’s ha escrito una clase bastante sencilla y muy útil para poder utilizar Zend_Cache File.

ejemplo de uso:

$cacheEnabled = (bool)getenv('THE_CACHE_ENABLED') ? getenv('THE_CACHE_ENABLED') : false;
TheCache::init($cacheEnabled, TMP_DIR.'/the-cache/');

$keyName = 'data-z-a-b'; // unique name describing this data set
$data = TheCache::load($keyName)
if($data === false) {
 $sql = 'SELECT x,y FROM z WHERE a=b';
 $rs = $db->Execute($sql);
 $data = $rs->GetArray();
 TheCache::save($keyName, $data);
}

enlace : http://akrabat.com/php/notes-on-zend_cache/

Comemtario