KumbiaPHP beta2-dev
Framework PHP en español
APC_cache.php
Ir a la documentación de este archivo.
00001 <?php
00023 class APCCache extends Cache
00024 {
00032         public function get($id, $group='default') 
00033     {
00034         $this->_id = $id;
00035         $this->_group = $group;
00036     
00037                 $data = apc_fetch("$id.$group");
00038                 if($data === FALSE){
00039                         return null;
00040                 }
00041                 return $data;
00042     }
00043     
00053         public function save($id, $group, $value, $lifetime)
00054     {
00055         if (! $id) {
00056             $id = $this->_id;
00057             $group = $this->_group;
00058         }
00059         
00060         if ($lifetime) {
00061             $lifetime = strtotime($lifetime) - time();
00062         } else {
00063             $lifetime = '0';
00064         }
00065     
00066         return apc_store("$id.$group", $value, $lifetime);
00067     }
00068     
00075         public function clean($group=false)
00076     {
00077                 return apc_clear_cache('user');
00078     }
00079     
00087         public function remove($id, $group='default')
00088     {
00089         return apc_delete("$id.$group");
00090     }
00091 }
 Todo Estructuras de Datos Namespaces Archivos Funciones Variables Enumeraciones