Make WordPress Core

Ticket #44445: 44445-remove-all.patch

File 44445-remove-all.patch, 846 bytes (added by ayeshrajans, 6 years ago)

Completely removes the dead __destruct and register_shutdown_function call.

  • src/wp-includes/cache.php

    diff --git a/src/wp-includes/cache.php b/src/wp-includes/cache.php
    index 5a4f2fbc39..6fb99dbf93 100644
    a b protected function _exists( $key, $group ) { 
    735735        public function __construct() {
    736736                $this->multisite   = is_multisite();
    737737                $this->blog_prefix = $this->multisite ? get_current_blog_id() . ':' : '';
    738 
    739                 /**
    740                  * @todo This should be moved to the PHP4 style constructor, PHP5
    741                  * already calls __destruct()
    742                  */
    743                 register_shutdown_function( array( $this, '__destruct' ) );
    744         }
    745 
    746         /**
    747          * Saves the object cache before object is completely destroyed.
    748          *
    749          * Called upon object destruction, which should be when PHP ends.
    750          *
    751          * @since 2.0.8
    752          *
    753          * @return true Always returns true.
    754          */
    755         public function __destruct() {
    756                 return true;
    757738        }
    758739}