Make WordPress Core

Changeset 53749


Ignore:
Timestamp:
07/21/2022 03:58:51 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk
Files:
1 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/phpcs.xml.dist

    r52978 r53749  
    166166    <!-- Whitelist the WP DB Class and related tests for usage of direct database access functions. -->
    167167    <rule ref="WordPress.DB.RestrictedFunctions">
    168         <exclude-pattern>/src/wp-includes/wp-db\.php</exclude-pattern>
     168        <exclude-pattern>/src/wp-includes/class-wpdb\.php</exclude-pattern>
    169169        <exclude-pattern>/tests/phpunit/tests/db/charset\.php</exclude-pattern>
    170170    </rule>
     
    326326    <rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
    327327        <exclude-pattern>/src/wp-admin/includes/class-wp-list-table-compat\.php</exclude-pattern>
     328        <exclude-pattern>/src/wp-includes/class-wp-dependency\.php</exclude-pattern>
    328329        <exclude-pattern>/src/wp-includes/class-wp-editor\.php</exclude-pattern>
    329330        <exclude-pattern>/src/wp-includes/class-wp-xmlrpc-server\.php</exclude-pattern>
    330         <exclude-pattern>/src/wp-includes/wp-db\.php</exclude-pattern>
    331         <exclude-pattern>/src/wp-includes/class-wp-dependency\.php</exclude-pattern>
     331        <exclude-pattern>/src/wp-includes/class-wpdb\.php</exclude-pattern>
    332332    </rule>
    333333
  • trunk/src/wp-admin/install.php

    r53450 r53749  
    4343
    4444/** Load wpdb */
    45 require_once ABSPATH . WPINC . '/wp-db.php';
     45require_once ABSPATH . WPINC . '/class-wpdb.php';
    4646
    4747nocache_headers();
  • trunk/src/wp-includes/class-wpdb.php

    r53748 r53749  
    11<?php
    22/**
    3  * WordPress database access abstraction class
     3 * WordPress database access abstraction class.
    44 *
    55 * Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}
  • trunk/src/wp-includes/load.php

    r53458 r53749  
    545545    global $wpdb;
    546546
    547     require_once ABSPATH . WPINC . '/wp-db.php';
     547    require_once ABSPATH . WPINC . '/class-wpdb.php';
     548
    548549    if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
    549550        require_once WP_CONTENT_DIR . '/db.php';
  • trunk/tests/phpunit/includes/install.php

    r52359 r53749  
    4141
    4242require_once ABSPATH . '/wp-admin/includes/upgrade.php';
    43 require_once ABSPATH . '/wp-includes/wp-db.php';
     43require_once ABSPATH . '/wp-includes/class-wpdb.php';
    4444
    4545// Override the PHPMailer.
Note: See TracChangeset for help on using the changeset viewer.