Make WordPress Core

Changeset 52694


Ignore:
Timestamp:
02/08/2022 11:28:04 PM (2 years ago)
Author:
peterwilsoncc
Message:

Options: Disable transients while installing.

Prevent the transient setters and getters from attempting to use the database table before they exist during the installation process.

During installation transients now use the wp_cache_*() functions on all sites, including those without a persistent cache, to prevent database errors. The use of the caching functions stores the data in memory for the duration of the request to account for transient data that is used multiple times during installation.

Props dd32, audrasjb, tnolte, antonvlasenko, noisysocks, peterwilsoncc.
Fixes #54849.

File:
1 edited

Legend:

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

    r52035 r52694  
    785785    do_action( "delete_transient_{$transient}", $transient );
    786786
    787     if ( wp_using_ext_object_cache() ) {
     787    if ( wp_using_ext_object_cache() || wp_installing() ) {
    788788        $result = wp_cache_delete( $transient, 'transient' );
    789789    } else {
     
    847847    }
    848848
    849     if ( wp_using_ext_object_cache() ) {
     849    if ( wp_using_ext_object_cache() || wp_installing() ) {
    850850        $value = wp_cache_get( $transient, 'transient' );
    851851    } else {
     
    931931    $expiration = apply_filters( "expiration_of_transient_{$transient}", $expiration, $value, $transient );
    932932
    933     if ( wp_using_ext_object_cache() ) {
     933    if ( wp_using_ext_object_cache() || wp_installing() ) {
    934934        $result = wp_cache_set( $transient, $value, 'transient', $expiration );
    935935    } else {
     
    18591859    do_action( "delete_site_transient_{$transient}", $transient );
    18601860
    1861     if ( wp_using_ext_object_cache() ) {
     1861    if ( wp_using_ext_object_cache() || wp_installing() ) {
    18621862        $result = wp_cache_delete( $transient, 'site-transient' );
    18631863    } else {
     
    19231923    }
    19241924
    1925     if ( wp_using_ext_object_cache() ) {
     1925    if ( wp_using_ext_object_cache() || wp_installing() ) {
    19261926        $value = wp_cache_get( $transient, 'site-transient' );
    19271927    } else {
     
    20042004    $expiration = apply_filters( "expiration_of_site_transient_{$transient}", $expiration, $value, $transient );
    20052005
    2006     if ( wp_using_ext_object_cache() ) {
     2006    if ( wp_using_ext_object_cache() || wp_installing() ) {
    20072007        $result = wp_cache_set( $transient, $value, 'site-transient', $expiration );
    20082008    } else {
Note: See TracChangeset for help on using the changeset viewer.