Make WordPress Core

Ticket #33734: clarify-cache-docs.diff

File clarify-cache-docs.diff, 4.8 KB (added by danielbachhuber, 10 years ago)

First pass at clarifying language

  • src/wp-includes/cache.php

    diff --git src/wp-includes/cache.php src/wp-includes/cache.php
    index 7aea7e2..50ff254 100644
     
    1515 *
    1616 * @global WP_Object_Cache $wp_object_cache
    1717 *
    18  * @param int|string $key The cache key to use for retrieval later
    19  * @param mixed $data The data to add to the cache store
    20  * @param string $group The group to add the cache to
    21  * @param int $expire When the cache data should be expired
    22  * @return bool False if cache key and group already exist, true on success
     18 * @param int|string $key The cache key to use for retrieval later.
     19 * @param mixed $data The data to add to the cache.
     20 * @param string $group The group to add the cache to. Enables the same key to be used across groups.
     21 * @param int $expire When the cache data should expire, in seconds. Default is 0 (no expiry).
     22 * @return bool False if cache key and group already exist, true on success.
    2323 */
    2424function wp_cache_add( $key, $data, $group = '', $expire = 0 ) {
    2525        global $wp_object_cache;
    function wp_cache_decr( $key, $offset = 1, $group = '' ) { 
    6868 *
    6969 * @global WP_Object_Cache $wp_object_cache
    7070 *
    71  * @param int|string $key What the contents in the cache are called
    72  * @param string $group Where the cache contents are grouped
    73  * @return bool True on successful removal, false on failure
     71 * @param int|string $key What the contents in the cache are called.
     72 * @param string $group Where the cache contents are grouped.
     73 * @return bool True on successful removal, false on failure.
    7474 */
    7575function wp_cache_delete($key, $group = '') {
    7676        global $wp_object_cache;
    function wp_cache_flush() { 
    100100 *
    101101 * @global WP_Object_Cache $wp_object_cache
    102102 *
    103  * @param int|string $key What the contents in the cache are called
    104  * @param string $group Where the cache contents are grouped
    105  * @param bool $force Whether to force an update of the local cache from the persistent cache (default is false)
     103 * @param int|string $key The key under which the cache contents are stored.
     104 * @param string $group Where the cache contents are grouped.
     105 * @param bool $force Whether to force an update of the local cache from the persistent cache (default is false).
    106106 * @param bool &$found Whether key was found in the cache. Disambiguates a return of false, a storable value.
    107107 * @return bool|mixed False on failure to retrieve contents or the cache
    108108 *                            contents on success
    function wp_cache_get( $key, $group = '', $force = false, &$found = null ) { 
    120120 *
    121121 * @global WP_Object_Cache $wp_object_cache
    122122 *
    123  * @param int|string $key The cache key to increment
     123 * @param int|string $key The key for the cache contents that should be incremented.
    124124 * @param int $offset The amount by which to increment the item's value. Default is 1.
    125125 * @param string $group The group the key is in.
    126126 * @return false|int False on failure, the item's new value on success.
    function wp_cache_init() { 
    149149 *
    150150 * @global WP_Object_Cache $wp_object_cache
    151151 *
    152  * @param int|string $key What to call the contents in the cache
    153  * @param mixed $data The contents to store in the cache
    154  * @param string $group Where to group the cache contents
    155  * @param int $expire When to expire the cache contents
    156  * @return bool False if not exists, true if contents were replaced
     152 * @param int|string $key The key for the cache data that should be replaced.
     153 * @param mixed $data The new data to store in the cache.
     154 * @param string $group The group for the cache data that should be replaced.
     155 * @param int $expire When to expire the cache contents, in seconds. Defaults to 0 (no expiry).
     156 * @return bool False if original value does not exist, true if contents were replaced
    157157 */
    158158function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
    159159        global $wp_object_cache;
    function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) { 
    164164/**
    165165 * Saves the data to the cache.
    166166 *
     167 * Differs from wp_cache_add() and wp_cache_replace() in that it will always write data.
     168 *
    167169 * @since 2.0.0
    168170 *
    169171 * @global WP_Object_Cache $wp_object_cache
    170172 *
    171  * @param int|string $key What to call the contents in the cache
    172  * @param mixed $data The contents to store in the cache
    173  * @param string $group Where to group the cache contents
    174  * @param int $expire When to expire the cache contents
     173 * @param int|string $key The cache key to use for retrieval later.
     174 * @param mixed $data The contents to store in the cache.
     175 * @param string $group Where to group the cache contents. Enables the same key to be used across groups.
     176 * @param int $expire When to expire the cache contents, in seconds. Defaults to 0 (no expiry).
    175177 * @return bool False on failure, true on success
    176178 */
    177179function wp_cache_set( $key, $data, $group = '', $expire = 0 ) {