Changeset 2393

Show
Ignore:
Timestamp:
04/01/2008 03:55:18 AM (8 months ago)
Author:
Geert
Message:

Fix #539

Location:
trunk/system/libraries/drivers/Cache
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/drivers/Cache/Apc.php

    r2007 r2393  
    2727                count($tags) and Log::add('error', 'Cache: tags are unsupported by the APC driver'); 
    2828 
     29                // APC expects time to live, not a unix timestamp 
     30                if ($expiration !== 0) 
     31                { 
     32                        $expiration -= time(); 
     33                } 
     34 
    2935                return apc_store($id, $data, $expiration); 
    3036        } 
     
    3844        { 
    3945                if ($id === TRUE) 
    40                 { 
    4146                        return apc_clear_cache('user'); 
    42                 } 
    43                 elseif ($tag == FALSE) 
    44                 { 
     47 
     48                if ($tag == FALSE) 
    4549                        return apc_delete($id); 
    46                 } 
    47                 else 
    48                 { 
    49                         return true; 
    50                 } 
     50 
     51                return TRUE; 
    5152        } 
    5253 
  • trunk/system/libraries/drivers/Cache/Eaccelerator.php

    r2007 r2393  
    3232                count($tags) and Log::add('error', 'tags are unsupported by the eAccelerator driver'); 
    3333 
     34                // eAccelerator expects time to live, not a unix timestamp 
     35                if ($expiration !== 0) 
     36                { 
     37                        $expiration -= time(); 
     38                } 
     39 
    3440                return eaccelerator_put($id, $data, $expiration); 
    3541        } 
     
    3844        { 
    3945                if ($id === TRUE) 
    40                 { 
    4146                        return eaccelerator_clean(); 
    42                 } 
    43                 elseif ($tag == FALSE) 
    44                 { 
     47 
     48                if ($tag == FALSE) 
    4549                        return eaccelerator_rm($id); 
    46                 } 
    47                 else 
    48                 { 
    49                         return TRUE; 
    50                 } 
     50 
     51                return TRUE; 
    5152        } 
    5253 
  • trunk/system/libraries/drivers/Cache/File.php

    r2007 r2393  
    204204        /** 
    205205         * Deletes all cache files that are older than the current time. 
     206         * 
     207         * @return void 
    206208         */ 
    207209        public function delete_expired() 
     
    222224        /** 
    223225         * Check if a cache file has expired by filename. 
     226         * 
     227         * @param  string  filename 
     228         * @return bool 
    224229         */ 
    225230        protected function expired($file) 
  • trunk/system/libraries/drivers/Cache/Memcache.php

    r2007 r2393  
    5555        { 
    5656                if ($id === TRUE) 
    57                 { 
    5857                        return $this->backend->flush(); 
    59                 } 
    60                 elseif ($tag == FALSE) 
    61                 { 
     58 
     59                if ($tag == FALSE) 
    6260                        return $this->backend->delete($id); 
    63                 } 
    64                 else 
    65                 { 
    66                         return TRUE; 
    67                 } 
     61 
     62                return TRUE; 
    6863        } 
    6964 
  • trunk/system/libraries/drivers/Cache/Xcache.php

    r2007 r2393  
    2929        { 
    3030                count($tags) and Log::add('error', 'Cache: tags are unsupported by the Xcache driver'); 
     31 
     32                // XCache expects time to live, not a unix timestamp 
     33                if ($expiration !== 0) 
     34                { 
     35                        $expiration -= time(); 
     36                } 
    3137 
    3238                return xcache_set($id, $data, $expiration);