Make WordPress Core

Changeset 56241


Ignore:
Timestamp:
07/16/2023 12:14:47 PM (16 months ago)
Author:
SergeyBiryukov
Message:

Bootstrap/Load: Require wp-includes/compat.php in src/index.php.

This allows for using polyfill functions if src/index.php is the entry point (this file exists as a reminder to build the assets, and is different from the actual index.php file that gets built and boots WordPress).

Includes:

  • Moving the check for the required PHP and MySQL versions earlier.
  • Making the load order consistent between src/index.php, wp-load.php, and wp-settings.php.

Follow-up to [46183], [56006], [56007].

Props westonruter, Presskopp, joemcgill, SergeyBiryukov.
See #58206.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/index.php

    r54650 r56241  
    2222
    2323define( 'WPINC', 'wp-includes' );
     24require_once ABSPATH . WPINC . '/version.php';
     25require_once ABSPATH . WPINC . '/compat.php';
    2426require_once ABSPATH . WPINC . '/load.php';
     27
     28// Check for the required PHP version and for the MySQL extension or a database drop-in.
     29wp_check_php_mysql_versions();
    2530
    2631// Standardize $_SERVER variables across setups.
    2732wp_fix_server_vars();
    2833
     34define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    2935require_once ABSPATH . WPINC . '/functions.php';
    30 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    31 require_once ABSPATH . WPINC . '/version.php';
    3236
    33 wp_check_php_mysql_versions();
    3437wp_load_translations_early();
    3538
  • trunk/src/wp-load.php

    r56006 r56241  
    6060
    6161    define( 'WPINC', 'wp-includes' );
     62    require_once ABSPATH . WPINC . '/version.php';
     63    require_once ABSPATH . WPINC . '/compat.php';
    6264    require_once ABSPATH . WPINC . '/load.php';
     65
     66    // Check for the required PHP version and for the MySQL extension or a database drop-in.
     67    wp_check_php_mysql_versions();
    6368
    6469    // Standardize $_SERVER variables across setups.
    6570    wp_fix_server_vars();
    6671
    67     require_once ABSPATH . WPINC . '/compat.php';
     72    define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    6873    require_once ABSPATH . WPINC . '/functions.php';
    6974
     
    7681    }
    7782
    78     define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    79     require_once ABSPATH . WPINC . '/version.php';
    80 
    81     wp_check_php_mysql_versions();
    8283    wp_load_translations_early();
    8384
  • trunk/src/wp-settings.php

    r56199 r56241  
    3232global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package;
    3333require ABSPATH . WPINC . '/version.php';
     34require ABSPATH . WPINC . '/compat.php';
    3435require ABSPATH . WPINC . '/load.php';
    3536
     
    3839
    3940// Include files required for initialization.
    40 require ABSPATH . WPINC . '/compat.php';
    4141require ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php';
    4242require ABSPATH . WPINC . '/class-wp-fatal-error-handler.php';
Note: See TracChangeset for help on using the changeset viewer.