Make WordPress Core


Ignore:
Timestamp:
01/23/2020 12:25:38 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Cache API: Remove WP_Object_Cache::__destruct() and wpdb::__destruct().

Originally added in [4686], these constructor/destructor pairings were designed to prevent the objects from being destroyed before shutdown, when output buffers are flushed.

A deeper investigation reveals that this approach didn't quite work as expected and was later made redundant by introducing wp_ob_end_flush_all() in [5462].

Props wonderboymusic, nacin, Mte90, SergeyBiryukov.
Fixes #21402.

File:
1 edited

Legend:

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

    r47088 r47107  
    605605     */
    606606    public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
    607         register_shutdown_function( array( $this, '__destruct' ) );
    608 
    609607        if ( WP_DEBUG && WP_DEBUG_DISPLAY ) {
    610608            $this->show_errors();
     
    631629
    632630        $this->db_connect();
    633     }
    634 
    635     /**
    636      * PHP5 style destructor and will run when database object is destroyed.
    637      *
    638      * @see wpdb::__construct()
    639      * @since 2.0.8
    640      * @return true
    641      */
    642     public function __destruct() {
    643         return true;
    644631    }
    645632
Note: See TracChangeset for help on using the changeset viewer.