WordPress.org

Make WordPress Core

Ticket #11621: 11621.diff

File 11621.diff, 4.1 KB (added by Denis-de-Bernardy, 8 years ago)
  • wp-includes/cache.php

     
    1212 * Adds data to the cache, if the cache key doesn't aleady exist.
    1313 *
    1414 * @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
    1716 *
    1817 * @param int|string $key The cache ID to use for retrieval later
    1918 * @param mixed $data The data to add to the cache store
     
    2221 * @return unknown
    2322 */
    2423function wp_cache_add($key, $data, $flag = '', $expire = 0) {
     24        /* @var $wp_object_cache WP_Object_Cache */
    2525        global $wp_object_cache;
    2626
    2727        return $wp_object_cache->add($key, $data, $flag, $expire);
     
    4747 * Removes the cache contents matching ID and flag.
    4848 *
    4949 * @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
    5251 *
    5352 * @param int|string $id What the contents in the cache are called
    5453 * @param string $flag Where the cache contents are grouped
    5554 * @return bool True on successful removal, false on failure
    5655 */
    5756function wp_cache_delete($id, $flag = '') {
     57        /* @var $wp_object_cache WP_Object_Cache */
    5858        global $wp_object_cache;
    5959
    6060        return $wp_object_cache->delete($id, $flag);
     
    6464 * Removes all cache items.
    6565 *
    6666 * @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
    6968 *
    70  * @return bool Always returns true
     69 * @return bool true
    7170 */
    7271function wp_cache_flush() {
     72        /* @var $wp_object_cache WP_Object_Cache */
    7373        global $wp_object_cache;
    7474
    7575        return $wp_object_cache->flush();
     
    7979 * Retrieves the cache contents from the cache by ID and flag.
    8080 *
    8181 * @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
    8483 *
    8584 * @param int|string $id What the contents in the cache are called
    8685 * @param string $flag Where the cache contents are grouped
    8786 * @return bool|mixed False on failure to retrieve contents or the cache
    8887 *              contents on success
    89  */
     88  */
    9089function wp_cache_get($id, $flag = '') {
     90        /* @var $wp_object_cache WP_Object_Cache */
    9191        global $wp_object_cache;
    9292
    9393        return $wp_object_cache->get($id, $flag);
     
    9797 * Sets up Object Cache Global and assigns it.
    9898 *
    9999 * @since 2.0.0
    100  * @global WP_Object_Cache $wp_object_cache WordPress Object Cache
    101100 */
    102101function wp_cache_init() {
    103102        $GLOBALS['wp_object_cache'] =& new WP_Object_Cache();
     
    107106 * Replaces the contents of the cache with new data.
    108107 *
    109108 * @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
    112110 *
    113111 * @param int|string $id What to call the contents in the cache
    114112 * @param mixed $data The contents to store in the cache
     
    117115 * @return bool False if cache ID and group already exists, true on success
    118116 */
    119117function wp_cache_replace($key, $data, $flag = '', $expire = 0) {
     118        /* @var $wp_object_cache WP_Object_Cache */
    120119        global $wp_object_cache;
    121120
    122121        return $wp_object_cache->replace($key, $data, $flag, $expire);
     
    126125 * Saves the data to the cache.
    127126 *
    128127 * @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
    131129 *
    132130 * @param int|string $id What to call the contents in the cache
    133131 * @param mixed $data The contents to store in the cache
     
    136134 * @return bool False if cache ID and group already exists, true on success
    137135 */
    138136function wp_cache_set($key, $data, $flag = '', $expire = 0) {
     137        /* @var $wp_object_cache WP_Object_Cache */     
    139138        global $wp_object_cache;
    140139
    141140        return $wp_object_cache->set($key, $data, $flag, $expire);
     
    279278         *
    280279         * @since 2.0.0
    281280         *
    282          * @return bool Always returns true
     281         * @return bool true
    283282         */
    284283        function flush() {
    285284                $this->cache = array ();
     
    449448                return true;
    450449        }
    451450}
    452 ?>
     451
     452?>
     453 No newline at end of file