Make WordPress Core

Changeset 47938

Timestamp:
06/09/2020 07:45:27 PM (4 years ago)
Author:
whyisjake
Message:

Cache API: Introduce wp_cache_get_multi().

Many caching backend have support for multiple gets in a single request. This brings that support to core, with a compatability fallback that will loop over requests if needed.

Fixes: #20875.
Props: nacin, tollmanz, wonderboymusic, ryan, jeremyfelt, spacedmonkey, boonebgorges, dd32, rmccue, ocean90, jipmoors, johnjamesjacoby, tillkruess, donmhico, davidbaumwald, SergeyBiryukov, whyisjake.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/cache.php

    r47197 r47938  
    128128
    129129/**
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
    130148 * Increment numeric cache item's value
    131149 *
  • trunk/src/wp-includes/class-wp-object-cache.php

    r47637 r47938  
    304304
    305305    /**
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
    306327     * Increments numeric cache item's value.
    307328     *
  • trunk/src/wp-includes/load.php

    r47919 r47938  
    629629    }
    630630
     631
     632
    631633    /*
    632634     * If cache supports reset, reset instead of init if already
  • trunk/tests/phpunit/tests/cache.php

    r47122 r47938  
    316316        $this->assertFalse( wp_cache_get( $fake_key ) );
    317317    }
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
    318337}
  • trunk/tests/phpunit/tests/pluggable.php

    r47122 r47938  
    291291                        'found' => null,
    292292                    ),
     293
     294
     295
     296
     297
    293298                    'wp_cache_incr'                      => array(
    294299                        'key',
Note: See TracChangeset for help on using the changeset viewer.