Changeset 3087
- Timestamp:
- 11/14/05 22:10:28 (3 years ago)
- Files:
-
- trunk/wp-includes/cache.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-includes/cache.php
r3086 r3087 20 20 function wp_cache_flush() { 21 21 global $wp_object_cache; 22 23 return $wp_object_cache->flush(); 22 24 } 23 25 … … 89 91 } 90 92 93 function flush() { 94 return $this->rm($this->cache_dir . '*'); 95 } 96 91 97 function get($id, $group = 'default', $count_hits = true) { 92 98 if ( empty($group) ) … … 197 203 198 204 return $this->cache_dir . "$group_dir/"; 205 } 206 207 function rm($fileglob) { 208 if (is_file($fileglob)) { 209 return @unlink($fileglob); 210 } else if (is_dir($fileglob)) { 211 $ok = $this->rm("$fileglob/*"); 212 if (! $ok) { 213 return false; 214 } 215 return @rmdir($fileglob); 216 } else { 217 $matching = glob($fileglob); 218 if ($matching === false) 219 return true; 220 $rcs = array_map(array('WP_Object_Cache', 'rm'), $matching); 221 if (in_array(false, $rcs)) { 222 return false; 223 } 224 } 225 return true; 199 226 } 200 227
