Ticket #11621: 11621.diff
File 11621.diff, 4.1 KB (added by , 15 years ago) |
---|
-
wp-includes/cache.php
12 12 * Adds data to the cache, if the cache key doesn't aleady exist. 13 13 * 14 14 * @since 2.0.0 15 * @uses $wp_object_cache Object Cache Class 16 * @see WP_Object_Cache::add() 15 * @global WP_Object_Cache WordPress Object Cache 17 16 * 18 17 * @param int|string $key The cache ID to use for retrieval later 19 18 * @param mixed $data The data to add to the cache store … … 22 21 * @return unknown 23 22 */ 24 23 function wp_cache_add($key, $data, $flag = '', $expire = 0) { 24 /* @var $wp_object_cache WP_Object_Cache */ 25 25 global $wp_object_cache; 26 26 27 27 return $wp_object_cache->add($key, $data, $flag, $expire); … … 47 47 * Removes the cache contents matching ID and flag. 48 48 * 49 49 * @since 2.0.0 50 * @uses $wp_object_cache Object Cache Class 51 * @see WP_Object_Cache::delete() 50 * @global WP_Object_Cache WordPress Object Cache 52 51 * 53 52 * @param int|string $id What the contents in the cache are called 54 53 * @param string $flag Where the cache contents are grouped 55 54 * @return bool True on successful removal, false on failure 56 55 */ 57 56 function wp_cache_delete($id, $flag = '') { 57 /* @var $wp_object_cache WP_Object_Cache */ 58 58 global $wp_object_cache; 59 59 60 60 return $wp_object_cache->delete($id, $flag); … … 64 64 * Removes all cache items. 65 65 * 66 66 * @since 2.0.0 67 * @uses $wp_object_cache Object Cache Class 68 * @see WP_Object_Cache::flush() 67 * @global WP_Object_Cache WordPress Object Cache 69 68 * 70 * @return bool Always returnstrue69 * @return bool true 71 70 */ 72 71 function wp_cache_flush() { 72 /* @var $wp_object_cache WP_Object_Cache */ 73 73 global $wp_object_cache; 74 74 75 75 return $wp_object_cache->flush(); … … 79 79 * Retrieves the cache contents from the cache by ID and flag. 80 80 * 81 81 * @since 2.0.0 82 * @uses $wp_object_cache Object Cache Class 83 * @see WP_Object_Cache::get() 82 * @global WP_Object_Cache WordPress Object Cache 84 83 * 85 84 * @param int|string $id What the contents in the cache are called 86 85 * @param string $flag Where the cache contents are grouped 87 86 * @return bool|mixed False on failure to retrieve contents or the cache 88 87 * contents on success 89 */88 */ 90 89 function wp_cache_get($id, $flag = '') { 90 /* @var $wp_object_cache WP_Object_Cache */ 91 91 global $wp_object_cache; 92 92 93 93 return $wp_object_cache->get($id, $flag); … … 97 97 * Sets up Object Cache Global and assigns it. 98 98 * 99 99 * @since 2.0.0 100 * @global WP_Object_Cache $wp_object_cache WordPress Object Cache101 100 */ 102 101 function wp_cache_init() { 103 102 $GLOBALS['wp_object_cache'] =& new WP_Object_Cache(); … … 107 106 * Replaces the contents of the cache with new data. 108 107 * 109 108 * @since 2.0.0 110 * @uses $wp_object_cache Object Cache Class 111 * @see WP_Object_Cache::replace() 109 * @global WP_Object_Cache WordPress Object Cache 112 110 * 113 111 * @param int|string $id What to call the contents in the cache 114 112 * @param mixed $data The contents to store in the cache … … 117 115 * @return bool False if cache ID and group already exists, true on success 118 116 */ 119 117 function wp_cache_replace($key, $data, $flag = '', $expire = 0) { 118 /* @var $wp_object_cache WP_Object_Cache */ 120 119 global $wp_object_cache; 121 120 122 121 return $wp_object_cache->replace($key, $data, $flag, $expire); … … 126 125 * Saves the data to the cache. 127 126 * 128 127 * @since 2.0 129 * @uses $wp_object_cache Object Cache Class 130 * @see WP_Object_Cache::set() 128 * @global WP_Object_Cache WordPress Object Cache 131 129 * 132 130 * @param int|string $id What to call the contents in the cache 133 131 * @param mixed $data The contents to store in the cache … … 136 134 * @return bool False if cache ID and group already exists, true on success 137 135 */ 138 136 function wp_cache_set($key, $data, $flag = '', $expire = 0) { 137 /* @var $wp_object_cache WP_Object_Cache */ 139 138 global $wp_object_cache; 140 139 141 140 return $wp_object_cache->set($key, $data, $flag, $expire); … … 279 278 * 280 279 * @since 2.0.0 281 280 * 282 * @return bool Always returnstrue281 * @return bool true 283 282 */ 284 283 function flush() { 285 284 $this->cache = array (); … … 449 448 return true; 450 449 } 451 450 } 452 ?> 451 452 ?> 453 No newline at end of file