Changeset 3135
- Timestamp:
- 07/17/2008 08:14:17 AM (5 months ago)
- Location:
- trunk/system/libraries
- Files:
-
- 8 modified
-
Cache.php (modified) (2 diffs)
-
drivers/Cache.php (modified) (1 diff)
-
drivers/Cache/Apc.php (modified) (1 diff)
-
drivers/Cache/Eaccelerator.php (modified) (1 diff)
-
drivers/Cache/File.php (modified) (3 diffs)
-
drivers/Cache/Memcache.php (modified) (1 diff)
-
drivers/Cache/Sqlite.php (modified) (1 diff)
-
drivers/Cache/Xcache.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Cache.php
r3134 r3135 99 99 /** 100 100 * Fetches a cache by id. Non-string cache items are automatically 101 * unserialized before the cache is returned. FALSEis returned when101 * unserialized before the cache is returned. NULL is returned when 102 102 * a cache item is not found. 103 103 * 104 104 * @param string cache id 105 * @return mixed cached data or FALSE105 * @return mixed cached data or NULL 106 106 */ 107 107 public function get($id) … … 137 137 { 138 138 // Load each cache item and add it to the array 139 if (($cache = $this->get($id)) !== FALSE)139 if (($cache = $this->get($id)) !== NULL) 140 140 { 141 141 $data[$id] = $cache; -
trunk/system/libraries/drivers/Cache.php
r2999 r3135 24 24 /** 25 25 * Get a cache item. 26 * Return FALSEif the cache item is not found.26 * Return NULL if the cache item is not found. 27 27 */ 28 28 public function get($id); -
trunk/system/libraries/drivers/Cache/Apc.php
r2999 r3135 20 20 public function get($id) 21 21 { 22 return apc_fetch($id);22 return (($return = apc_fetch($id)) === FALSE) ? NULL : $return; 23 23 } 24 24 -
trunk/system/libraries/drivers/Cache/Eaccelerator.php
r2999 r3135 20 20 public function get($id) 21 21 { 22 return (($return = eaccelerator_get($id)) === NULL) ? FALSE : $return;22 return eaccelerator_get($id); 23 23 } 24 24 -
trunk/system/libraries/drivers/Cache/File.php
r2999 r3135 137 137 * the hash does not match the stored hash. 138 138 * 139 * @param string cache id140 * @return mixed|NULL139 * @param string cache id 140 * @return mixed|NULL 141 141 */ 142 142 public function get($id) … … 174 174 } 175 175 176 // Return FALSEif there is no data177 return isset($data) ? $data : FALSE;176 // Return NULL if there is no data 177 return isset($data) ? $data : NULL; 178 178 } 179 179 … … 181 181 * Deletes a cache item by id or tag 182 182 * 183 * @param stringcache id or tag, or TRUE for "all items"184 * @param booluse tags185 * @return bool183 * @param string cache id or tag, or TRUE for "all items" 184 * @param boolean use tags 185 * @return boolean 186 186 */ 187 187 public function delete($id, $tag = FALSE) -
trunk/system/libraries/drivers/Cache/Memcache.php
r2899 r3135 44 44 public function get($id) 45 45 { 46 return $this->backend->get($id);46 return (($return = $this->backend->get($id)) === FALSE) ? NULL : $return; 47 47 } 48 48 -
trunk/system/libraries/drivers/Cache/Sqlite.php
r2999 r3135 177 177 } 178 178 179 // No valid cache fou d180 return FALSE;179 // No valid cache found 180 return NULL; 181 181 } 182 182 -
trunk/system/libraries/drivers/Cache/Xcache.php
r3008 r3135 23 23 return xcache_get($id); 24 24 25 return FALSE;25 return NULL; 26 26 } 27 27
