Coding Standards: Move wp-includes/wp-db.php to wp-includes/class-wpdb.php.

This renames the file containing the `wpdb` class to conform to the coding standards.

This commit also includes:
* A new `wp-db.php` that loads the new file, for anyone that may have been including the file directly.
* Replacing references to the old filename with the new filename.

Fixes #56268. See #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53749 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2022-07-21 15:58:51 +00:00
parent b01c8f193b
commit fdb6e13fed
6 changed files with 4032 additions and 4017 deletions

View File

@ -165,7 +165,7 @@
<!-- Whitelist the WP DB Class and related tests for usage of direct database access functions. -->
<rule ref="WordPress.DB.RestrictedFunctions">
<exclude-pattern>/src/wp-includes/wp-db\.php</exclude-pattern>
<exclude-pattern>/src/wp-includes/class-wpdb\.php</exclude-pattern>
<exclude-pattern>/tests/phpunit/tests/db/charset\.php</exclude-pattern>
</rule>
@ -325,10 +325,10 @@
</rule>
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
<exclude-pattern>/src/wp-admin/includes/class-wp-list-table-compat\.php</exclude-pattern>
<exclude-pattern>/src/wp-includes/class-wp-dependency\.php</exclude-pattern>
<exclude-pattern>/src/wp-includes/class-wp-editor\.php</exclude-pattern>
<exclude-pattern>/src/wp-includes/class-wp-xmlrpc-server\.php</exclude-pattern>
<exclude-pattern>/src/wp-includes/wp-db\.php</exclude-pattern>
<exclude-pattern>/src/wp-includes/class-wp-dependency\.php</exclude-pattern>
<exclude-pattern>/src/wp-includes/class-wpdb\.php</exclude-pattern>
</rule>
<!-- Exclude some incorrectly named files that won't be renamed. -->

View File

@ -42,7 +42,7 @@ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
/** Load wpdb */
require_once ABSPATH . WPINC . '/wp-db.php';
require_once ABSPATH . WPINC . '/class-wpdb.php';
nocache_headers();

File diff suppressed because it is too large Load Diff

View File

@ -544,7 +544,8 @@ function wp_set_lang_dir() {
function require_wp_db() {
global $wpdb;
require_once ABSPATH . WPINC . '/wp-db.php';
require_once ABSPATH . WPINC . '/class-wpdb.php';
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
require_once WP_CONTENT_DIR . '/db.php';
}

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ tests_add_filter( 'wp_die_handler', '_wp_die_handler_filter_exit' );
require_once ABSPATH . '/wp-settings.php';
require_once ABSPATH . '/wp-admin/includes/upgrade.php';
require_once ABSPATH . '/wp-includes/wp-db.php';
require_once ABSPATH . '/wp-includes/class-wpdb.php';
// Override the PHPMailer.
global $phpmailer;