Ticket #16274: 16274.diff
| File 16274.diff, 1.9 KB (added by , 15 years ago) |
|---|
-
wp-includes/cache.php
206 206 var $cache = array (); 207 207 208 208 /** 209 * Cache objects that do not exist in the cache210 *211 * @var array212 * @access private213 * @since 2.0.0214 */215 var $non_existent_objects = array ();216 217 /**218 209 * The amount of times the cache data was already stored in the cache. 219 210 * 220 211 * @since 2.5.0 … … 287 278 * to false, then nothing will happen. The $force parameter is set to false 288 279 * by default. 289 280 * 290 * On success the group and the id will be added to the291 * $non_existent_objects property in the class.292 *293 281 * @since 2.0.0 294 282 * 295 283 * @param int|string $id What the contents in the cache are called … … 306 294 return false; 307 295 308 296 unset ($this->cache[$group][$id]); 309 $this->non_existent_objects[$group][$id] = true;310 297 return true; 311 298 } 312 299 … … 330 317 * ID in the cache group. If the cache is hit (success) then the contents 331 318 * are returned. 332 319 * 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. 338 321 * 339 322 * @since 2.0.0 340 323 * … … 355 338 return $this->cache[$group][$id]; 356 339 } 357 340 358 if ( isset ($this->non_existent_objects[$group][$id]) )359 return false;360 361 $this->non_existent_objects[$group][$id] = true;362 341 $this->cache_misses += 1; 363 342 return false; 364 343 } … … 429 408 $data = wp_clone($data); 430 409 431 410 $this->cache[$group][$id] = $data; 432 433 if ( isset($this->non_existent_objects[$group][$id]) )434 unset ($this->non_existent_objects[$group][$id]);435 436 411 return true; 437 412 } 438 413