Make WordPress Core

Changeset 57089


Ignore:
Timestamp:
11/08/2023 08:31:34 PM (3 years ago)
Author:
hellofromTonya
Message:

Database: Reinstate wpdb::$use_mysqli property.

Partial revert of [56475] to reinstate the private wpdb::$use_mysqli property and set to its default to true. This private property was / is accessible through the magic methods. Though Core's usage of this property was removed by [56475], plugins are using the property. Reinstating it resolves the BC break.

Follow up to [56475].

Props jason_the_adams, joemcgill, johnbillion, johnjamesjacoby, jrf, rajinsharwar, renehermi.
Fixes #59846.

Location:
trunk
Files:
2 edited

Legend:

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

    r56549 r57089  
    690690         */
    691691        private $allow_unsafe_unquoted_parameters = true;
     692
     693        /**
     694         * Whether to use the mysqli extension over mysql. This is no longer used as the mysql
     695         * extension is no longer supported.
     696         *
     697         * Default true.
     698         *
     699         * @since 3.9.0
     700         * @since 6.4.0 This property was removed.
     701         * @since 6.4.1 This property was reinstated and its default value was changed to true.
     702         *              The property is no longer used in core but may be accessed externally.
     703         *
     704         * @var bool
     705         */
     706        private $use_mysqli = true;
    692707
    693708        /**
  • trunk/tests/phpunit/tests/db.php

    r56475 r57089  
    24702470                );
    24712471        }
     2472
     2473        /**
     2474         * This private property is no longer used but needs to be retained as it can be
     2475         * accessed externally due to the `__get()` magic method.
     2476         *
     2477         * @ticket 59118
     2478         * @ticket 59846
     2479         */
     2480        public function test_use_mysqli_property_access() {
     2481                global $wpdb;
     2482
     2483                $this->assertTrue( $wpdb->use_mysqli );
     2484        }
    24722485}
Note: See TracChangeset for help on using the changeset viewer.