Changeset 28502 for trunk/src/wp-includes/cache.php
- Timestamp:
- 05/19/2014 05:15:20 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cache.php
r27162 r28502 269 269 * @since 2.0.0 270 270 */ 271 var$cache = array ();271 private $cache = array (); 272 272 273 273 /** … … 278 278 * @var int 279 279 */ 280 var$cache_hits = 0;280 private $cache_hits = 0; 281 281 282 282 /** … … 287 287 * @since 2.0.0 288 288 */ 289 var$cache_misses = 0;289 public $cache_misses = 0; 290 290 291 291 /** … … 296 296 * @since 3.0.0 297 297 */ 298 var$global_groups = array();298 protected $global_groups = array(); 299 299 300 300 /** … … 305 305 * @since 3.5.0 306 306 */ 307 var $blog_prefix; 307 private $blog_prefix; 308 309 /** 310 * Make private properties readable for backwards compatibility 311 * 312 * @since 4.0.0 313 * @param string $name 314 * @return mixed 315 */ 316 public function __get( $name ) { 317 return $this->$name; 318 } 308 319 309 320 /** … … 322 333 * @return bool False if cache key and group already exist, true on success 323 334 */ 324 function add( $key, $data, $group = 'default', $expire = 0 ) {335 public function add( $key, $data, $group = 'default', $expire = 0 ) { 325 336 if ( wp_suspend_cache_addition() ) 326 337 return false; … … 346 357 * @param array $groups List of groups that are global. 347 358 */ 348 function add_global_groups( $groups ) {359 public function add_global_groups( $groups ) { 349 360 $groups = (array) $groups; 350 361 … … 363 374 * @return false|int False on failure, the item's new value on success. 364 375 */ 365 function decr( $key, $offset = 1, $group = 'default' ) {376 public function decr( $key, $offset = 1, $group = 'default' ) { 366 377 if ( empty( $group ) ) 367 378 $group = 'default'; … … 399 410 * @return bool False if the contents weren't deleted and true on success 400 411 */ 401 function delete( $key, $group = 'default', $deprecated = false ) {412 public function delete( $key, $group = 'default', $deprecated = false ) { 402 413 if ( empty( $group ) ) 403 414 $group = 'default'; … … 420 431 * @return bool Always returns true 421 432 */ 422 function flush() {433 public function flush() { 423 434 $this->cache = array (); 424 435 … … 443 454 * contents on success 444 455 */ 445 function get( $key, $group = 'default', $force = false, &$found = null ) {456 public function get( $key, $group = 'default', $force = false, &$found = null ) { 446 457 if ( empty( $group ) ) 447 458 $group = 'default'; … … 474 485 * @return false|int False on failure, the item's new value on success. 475 486 */ 476 function incr( $key, $offset = 1, $group = 'default' ) {487 public function incr( $key, $offset = 1, $group = 'default' ) { 477 488 if ( empty( $group ) ) 478 489 $group = 'default'; … … 509 520 * @return bool False if not exists, true if contents were replaced 510 521 */ 511 function replace( $key, $data, $group = 'default', $expire = 0 ) {522 public function replace( $key, $data, $group = 'default', $expire = 0 ) { 512 523 if ( empty( $group ) ) 513 524 $group = 'default'; … … 529 540 * @deprecated 3.5.0 530 541 */ 531 function reset() {542 public function reset() { 532 543 _deprecated_function( __FUNCTION__, '3.5', 'switch_to_blog()' ); 533 544 … … 559 570 * @return bool Always returns true 560 571 */ 561 function set( $key, $data, $group = 'default', $expire = 0 ) {572 public function set( $key, $data, $group = 'default', $expire = 0 ) { 562 573 if ( empty( $group ) ) 563 574 $group = 'default'; … … 581 592 * @since 2.0.0 582 593 */ 583 function stats() {594 public function stats() { 584 595 echo "<p>"; 585 596 echo "<strong>Cache Hits:</strong> {$this->cache_hits}<br />"; … … 602 613 * @param int $blog_id Blog ID 603 614 */ 604 function switch_to_blog( $blog_id ) {615 public function switch_to_blog( $blog_id ) { 605 616 $blog_id = (int) $blog_id; 606 617 $this->blog_prefix = $this->multisite ? $blog_id . ':' : ''; … … 624 635 * @return null|WP_Object_Cache If cache is disabled, returns null. 625 636 */ 626 function __construct() {637 public function __construct() { 627 638 global $blog_id; 628 639 … … 647 658 * @return bool True value. Won't be used by PHP 648 659 */ 649 function __destruct() {660 public function __destruct() { 650 661 return true; 651 662 }
Note: See TracChangeset
for help on using the changeset viewer.