mirror of
git://develop.git.wordpress.org/
synced 2025-04-11 15:42:03 +02:00
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. Merges [52694] to the 5.9 branch. Fixes #54849. git-svn-id: https://develop.svn.wordpress.org/branches/5.9@52767 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
632b4c9b70
commit
de80656938
@ -784,7 +784,7 @@ function delete_transient( $transient ) {
|
||||
*/
|
||||
do_action( "delete_transient_{$transient}", $transient );
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
if ( wp_using_ext_object_cache() || wp_installing() ) {
|
||||
$result = wp_cache_delete( $transient, 'transient' );
|
||||
} else {
|
||||
$option_timeout = '_transient_timeout_' . $transient;
|
||||
@ -846,7 +846,7 @@ function get_transient( $transient ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
if ( wp_using_ext_object_cache() || wp_installing() ) {
|
||||
$value = wp_cache_get( $transient, 'transient' );
|
||||
} else {
|
||||
$transient_option = '_transient_' . $transient;
|
||||
@ -930,7 +930,7 @@ function set_transient( $transient, $value, $expiration = 0 ) {
|
||||
*/
|
||||
$expiration = apply_filters( "expiration_of_transient_{$transient}", $expiration, $value, $transient );
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
if ( wp_using_ext_object_cache() || wp_installing() ) {
|
||||
$result = wp_cache_set( $transient, $value, 'transient', $expiration );
|
||||
} else {
|
||||
$transient_timeout = '_transient_timeout_' . $transient;
|
||||
@ -1858,7 +1858,7 @@ function delete_site_transient( $transient ) {
|
||||
*/
|
||||
do_action( "delete_site_transient_{$transient}", $transient );
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
if ( wp_using_ext_object_cache() || wp_installing() ) {
|
||||
$result = wp_cache_delete( $transient, 'site-transient' );
|
||||
} else {
|
||||
$option_timeout = '_site_transient_timeout_' . $transient;
|
||||
@ -1922,7 +1922,7 @@ function get_site_transient( $transient ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
if ( wp_using_ext_object_cache() || wp_installing() ) {
|
||||
$value = wp_cache_get( $transient, 'site-transient' );
|
||||
} else {
|
||||
// Core transients that do not have a timeout. Listed here so querying timeouts can be avoided.
|
||||
@ -2003,7 +2003,7 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
|
||||
*/
|
||||
$expiration = apply_filters( "expiration_of_site_transient_{$transient}", $expiration, $value, $transient );
|
||||
|
||||
if ( wp_using_ext_object_cache() ) {
|
||||
if ( wp_using_ext_object_cache() || wp_installing() ) {
|
||||
$result = wp_cache_set( $transient, $value, 'site-transient', $expiration );
|
||||
} else {
|
||||
$transient_timeout = '_site_transient_timeout_' . $transient;
|
||||
|
Loading…
x
Reference in New Issue
Block a user