Make WordPress Core

Ticket #16274: 16274.diff

File 16274.diff, 1.9 KB (added by duck_, 15 years ago)
  • wp-includes/cache.php

     
    206206        var $cache = array ();
    207207
    208208        /**
    209          * Cache objects that do not exist in the cache
    210          *
    211          * @var array
    212          * @access private
    213          * @since 2.0.0
    214          */
    215         var $non_existent_objects = array ();
    216 
    217         /**
    218209         * The amount of times the cache data was already stored in the cache.
    219210         *
    220211         * @since 2.5.0
     
    287278         * to false, then nothing will happen. The $force parameter is set to false
    288279         * by default.
    289280         *
    290          * On success the group and the id will be added to the
    291          * $non_existent_objects property in the class.
    292          *
    293281         * @since 2.0.0
    294282         *
    295283         * @param int|string $id What the contents in the cache are called
     
    306294                        return false;
    307295
    308296                unset ($this->cache[$group][$id]);
    309                 $this->non_existent_objects[$group][$id] = true;
    310297                return true;
    311298        }
    312299
     
    330317         * ID in the cache group. If the cache is hit (success) then the contents
    331318         * are returned.
    332319         *
    333          * On failure, the $non_existent_objects property is checked and if the
    334          * cache group and ID exist in there the cache misses will not be
    335          * incremented. If not in the nonexistent objects property, then the cache
    336          * misses will be incremented and the cache group and ID will be added to
    337          * the nonexistent objects.
     320         * On failure, the number of cache misses will be incremented.
    338321         *
    339322         * @since 2.0.0
    340323         *
     
    355338                                return $this->cache[$group][$id];
    356339                }
    357340
    358                 if ( isset ($this->non_existent_objects[$group][$id]) )
    359                         return false;
    360 
    361                 $this->non_existent_objects[$group][$id] = true;
    362341                $this->cache_misses += 1;
    363342                return false;
    364343        }
     
    429408                        $data = wp_clone($data);
    430409
    431410                $this->cache[$group][$id] = $data;
    432 
    433                 if ( isset($this->non_existent_objects[$group][$id]) )
    434                         unset ($this->non_existent_objects[$group][$id]);
    435 
    436411                return true;
    437412        }
    438413