Show
Ignore:
Timestamp:
05/25/08 15:45:05 (3 months ago)
Author:
ryan
Message:

phpdoc updates from jacobsantos. see #7038

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/cache.php

    r7986 r7990  
    22/** 
    33 * Object Cache API 
     4 * 
     5 * @link http://codex.wordpress.org/Function_Reference/WP_Cache 
    46 * 
    57 * @package WordPress 
     
    810 
    911/** 
    10  * wp_cache_add() - Adds data to the cache, if the cache key doesn't aleady exist 
     12 * Adds data to the cache, if the cache key doesn't aleady exist. 
    1113 * 
    1214 * @since 2.0 
     
    2729 
    2830/** 
    29  * wp_cache_close() - Closes the cache 
    30  * 
    31  * This function has ceased to do anything since WordPress 2.5. 
    32  * The functionality was removed along with the rest of the 
    33  * persistant cache. 
     31 * Closes the cache. 
     32 * 
     33 * This function has ceased to do anything since WordPress 2.5. The 
     34 * functionality was removed along with the rest of the persistant cache. This 
     35 * does not mean that plugins can't implement this function when they need to 
     36 * make sure that the cache is cleaned up after WordPress no longer needs it. 
    3437 * 
    3538 * @since 2.0 
     
    4245 
    4346/** 
    44  * wp_cache_delete() - Removes the cache contents matching ID and flag 
     47 * Removes the cache contents matching ID and flag. 
    4548 * 
    4649 * @since 2.0 
     
    5962 
    6063/** 
    61  * wp_cache_flush() - Removes all cache items 
     64 * Removes all cache items. 
    6265 * 
    6366 * @since 2.0 
     
    7477 
    7578/** 
    76  * wp_cache_get() - Retrieves the cache contents from the cache by ID and flag 
     79 * Retrieves the cache contents from the cache by ID and flag. 
    7780 * 
    7881 * @since 2.0 
     
    8285 * @param int|string $id What the contents in the cache are called 
    8386 * @param string $flag Where the cache contents are grouped 
    84  * @return bool|mixed False on failure to retrieve contents or the cache contents on success 
     87 * @return bool|mixed False on failure to retrieve contents or the cache 
     88 *      contents on success 
    8589 */ 
    8690function wp_cache_get($id, $flag = '') { 
     
    9195 
    9296/** 
    93  * wp_cache_init() - Sets up Object Cache Global and assigns it 
     97 * Sets up Object Cache Global and assigns it. 
    9498 * 
    9599 * @since 2.0 
     
    101105 
    102106/** 
    103  * wp_cache_replace() - Replaces the contents of the cache with new data 
     107 * Replaces the contents of the cache with new data. 
    104108 * 
    105109 * @since 2.0 
     
    120124 
    121125/** 
    122  * wp_cache_set() - Saves the data to the cache 
     126 * Saves the data to the cache. 
    123127 * 
    124128 * @since 2.0 
     
    139143 
    140144/** 
    141  * wp_cache_add_global_groups() - Adds a group or set of groups to the list of global groups 
     145 * Adds a group or set of groups to the list of global groups. 
    142146 * 
    143147 * @since 2.6 
     
    151155 
    152156/** 
    153  * wp_cache_add_non_persistent_groups() - Adds a group or set of groups to the list of non-persistent groups 
     157 * Adds a group or set of groups to the list of non-persistent groups. 
    154158 * 
    155159 * @since 2.6 
     
    165169 * WordPress Object Cache 
    166170 * 
    167  * The WordPress Object Cache is used to save on trips to the database. 
    168  * The Object Cache stores all of the cache data to memory and makes the 
    169  * cache contents available by using a key, which is used to name and 
    170  * later retrieve the cache contents. 
    171  * 
    172  * The Object Cache can be replaced by other caching mechanisms by placing 
    173  * files in the wp-content folder which is looked at in wp-settings. If 
    174  * that file exists, then this file will not be included. 
     171 * The WordPress Object Cache is used to save on trips to the database. The 
     172 * Object Cache stores all of the cache data to memory and makes the cache 
     173 * contents available by using a key, which is used to name and later retrieve 
     174 * the cache contents. 
     175 * 
     176 * The Object Cache can be replaced by other caching mechanisms by placing files 
     177 * in the wp-content folder which is looked at in wp-settings. If that file 
     178 * exists, then this file will not be included. 
    175179 * 
    176180 * @package WordPress 
     
    220224     * 
    221225     * @uses WP_Object_Cache::get Checks to see if the cache already has data. 
    222      * @uses WP_Object_Cache::set Sets the data after the checking the cache contents existance. 
     226     * @uses WP_Object_Cache::set Sets the data after the checking the cache 
     227     *      contents existance. 
    223228     * 
    224229     * @since 2.0 
     
    243248     * Remove the contents of the cache ID in the group 
    244249     * 
    245      * If the cache ID does not exist in the group and $force parameter 
    246      * is set to false, then nothing will happen. The $force parameter 
    247      * is set to false by default. 
    248      * 
    249      * On success the group and the id will be added to the 
     250     * If the cache ID does not exist in the group and $force parameter is set 
     251     * to false, then nothing will happen. The $force parameter is set to false 
     252     * by default. 
     253     * 
     254     * On success the group and the id will be added to the  
    250255     * $non_existant_objects property in the class. 
    251256     * 
     
    254259     * @param int|string $id What the contents in the cache are called 
    255260     * @param string $group Where the cache contents are grouped 
    256      * @param bool $force Optional. Whether to force the unsetting of the cache ID in the group 
     261     * @param bool $force Optional. Whether to force the unsetting of the cache 
     262     *      ID in the group 
    257263     * @return bool False if the contents weren't deleted and true on success 
    258264     */ 
     
    285291     * Retrieves the cache contents, if it exists 
    286292     * 
    287      * The contents will be first attempted to be retrieved by searching 
    288      * by the ID in the cache group. If the cache is hit (success) then 
    289      * the contents are returned. 
    290      * 
    291      * On failure, the $non_existant_objects property is checked and if 
    292      * the cache group and ID exist in there the cache misses will not be 
    293      * incremented. If not in the nonexistant objects property, then the 
    294      * cache misses will be incremented and the cache group and ID will 
    295      * be added to the nonexistant objects. 
     293     * The contents will be first attempted to be retrieved by searching by the 
     294     * ID in the cache group. If the cache is hit (success) then the contents 
     295     * are returned. 
     296     * 
     297     * On failure, the $non_existant_objects property is checked and if the 
     298     * cache group and ID exist in there the cache misses will not be 
     299     * incremented. If not in the nonexistant objects property, then the cache 
     300     * misses will be incremented and the cache group and ID will be added to 
     301     * the nonexistant objects. 
    296302     * 
    297303     * @since 2.0 
     
    299305     * @param int|string $id What the contents in the cache are called 
    300306     * @param string $group Where the cache contents are grouped 
    301      * @return bool|mixed False on failure to retrieve contents or the cache contents on success 
     307     * @return bool|mixed False on failure to retrieve contents or the cache 
     308     *      contents on success 
    302309     */ 
    303310    function get($id, $group = 'default') { 
     
    343350     * Sets the data contents into the cache 
    344351     * 
    345      * The cache contents is grouped by the $group parameter followed 
    346      * by the $id. This allows for duplicate ids in unique groups. 
    347      * Therefore, naming of the group should be used with care and 
    348      * should follow normal function naming guidelines outside of 
    349      * core WordPress usage. 
    350      * 
    351      * The $expire parameter is not used, because the cache will 
    352      * automatically expire for each time a page is accessed and PHP 
    353      * finishes. The method is more for cache plugins which use files. 
     352     * The cache contents is grouped by the $group parameter followed by the 
     353     * $id. This allows for duplicate ids in unique groups. Therefore, naming of 
     354     * the group should be used with care and should follow normal function 
     355     * naming guidelines outside of core WordPress usage. 
     356     * 
     357     * The $expire parameter is not used, because the cache will automatically 
     358     * expire for each time a page is accessed and PHP finishes. The method is 
     359     * more for cache plugins which use files. 
    354360     * 
    355361     * @since 2.0 
     
    379385     * Echos the stats of the caching. 
    380386     * 
    381      * Gives the cache hits, and cache misses. Also prints every cached 
    382      * group, key and the data. 
     387     * Gives the cache hits, and cache misses. Also prints every cached group, 
     388     * key and the data. 
    383389     * 
    384390     * @since 2.0 
     
    418424     */ 
    419425    function __construct() { 
    420         register_shutdown_function(array(&$this, "__destruct")); /** @todo This should be moved to the PHP4 style constructor, PHP5 already calls __destruct() */ 
     426        /** 
     427         * @todo This should be moved to the PHP4 style constructor, PHP5 
     428         * already calls __destruct() 
     429         */ 
     430        register_shutdown_function(array(&$this, "__destruct")); 
    421431    } 
    422432