Changeset 1420

Show
Ignore:
Timestamp:
12/04/2007 11:00:30 PM (12 months ago)
Author:
Shadowhand
Message:

Updates to Cache:

  • Cache library should not call del() when setting items, it's not always necessary
  • Cache interface no longer requires the exists() method, it's not always necessary
  • Added Cache_Sqlite driver
  • Cache_File::set() changed to call a del()
Location:
trunk/system/libraries
Files:
1 added
3 modified

Legend:

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

    r1402 r1420  
    168168                } 
    169169 
    170                 // Remove old cache files 
    171                 $this->driver->del($id); 
    172  
    173170                return $this->driver->set($id, $data, $tags, $lifetime); 
    174171        } 
  • trunk/system/libraries/drivers/Cache.php

    r1315 r1420  
    55interface Cache_Driver 
    66{ 
    7  
    8         /** 
    9          * Test if a cache exists by id or tag. 
    10          */ 
    11         public function exists($id, $tag = FALSE); 
    127 
    138        /** 
  • trunk/system/libraries/drivers/Cache_File.php

    r1411 r1420  
    8888        public function set($id, $data, $tags, $expiration) 
    8989        { 
     90                // Remove old cache files 
     91                $this->del($id); 
     92 
     93                // Construct the filename 
    9094                $filename = $id.'~'.implode('+', $tags).'~'.$expiration; 
    9195