diff --git a/wp-includes/cache.php b/wp-includes/cache.php index a5a548ccd2..ea14e78b4d 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -335,6 +335,16 @@ class WP_Object_Cache { */ private $multisite; + /** + * Sets up object properties; PHP 5 style constructor. + * + * @since 2.0.8 + */ + public function __construct() { + $this->multisite = is_multisite(); + $this->blog_prefix = $this->multisite ? get_current_blog_id() . ':' : ''; + } + /** * Makes private properties readable for backward compatibility. * @@ -726,33 +736,4 @@ class WP_Object_Cache { protected function _exists( $key, $group ) { return isset( $this->cache[ $group ] ) && ( isset( $this->cache[ $group ][ $key ] ) || array_key_exists( $key, $this->cache[ $group ] ) ); } - - /** - * Sets up object properties; PHP 5 style constructor. - * - * @since 2.0.8 - */ - public function __construct() { - $this->multisite = is_multisite(); - $this->blog_prefix = $this->multisite ? get_current_blog_id() . ':' : ''; - - /** - * @todo This should be moved to the PHP4 style constructor, PHP5 - * already calls __destruct() - */ - register_shutdown_function( array( $this, '__destruct' ) ); - } - - /** - * Saves the object cache before object is completely destroyed. - * - * Called upon object destruction, which should be when PHP ends. - * - * @since 2.0.8 - * - * @return true Always returns true. - */ - public function __destruct() { - return true; - } } diff --git a/wp-includes/version.php b/wp-includes/version.php index d0caa98ab9..22c3d2aecc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-47106'; +$wp_version = '5.4-alpha-47107'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 7ea8d7f756..1bb7da4e66 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -604,8 +604,6 @@ class wpdb { * @param string $dbhost MySQL database host */ public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) { - register_shutdown_function( array( $this, '__destruct' ) ); - if ( WP_DEBUG && WP_DEBUG_DISPLAY ) { $this->show_errors(); } @@ -632,17 +630,6 @@ class wpdb { $this->db_connect(); } - /** - * PHP5 style destructor and will run when database object is destroyed. - * - * @see wpdb::__construct() - * @since 2.0.8 - * @return true - */ - public function __destruct() { - return true; - } - /** * Makes private properties readable for backward compatibility. *