Make WordPress Core


Ignore:
Timestamp:
09/19/2019 12:01:03 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Bootstrap/Load: Reorganize the initialization flow so that the check for PHP and MySQL requirements could run as early as possible.

This allows us to use PHP 5.6+ syntax in more files, and display a proper error message on older PHP versions, instead of causing a parse error.

Fixes #48059.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r46111 r46183  
    1616define( 'WPINC', 'wp-includes' );
    1717
     18/*
     19 * These can't be directly globalized in version.php. When updating,
     20 * we're including version.php from another installation and don't want
     21 * these values to be overridden if already set.
     22 */
     23global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package;
     24require( ABSPATH . WPINC . '/version.php' );
     25require( ABSPATH . WPINC . '/load.php' );
     26
     27// Check for the required PHP version and for the MySQL extension or a database drop-in.
     28wp_check_php_mysql_versions();
     29
    1830// Include files required for initialization.
    19 require( ABSPATH . WPINC . '/load.php' );
    2031require( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' );
    2132require( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' );
     
    2940require_once( ABSPATH . WPINC . '/plugin.php' );
    3041
    31 /*
    32  * These can't be directly globalized in version.php. When updating,
    33  * we're including version.php from another installation and don't want
    34  * these values to be overridden if already set.
    35  */
    36 global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package;
    37 require( ABSPATH . WPINC . '/version.php' );
    38 
    3942/**
    4043 * If not already configured, `$blog_id` will default to 1 in a single site
     
    5154// Make sure we register the shutdown handler for fatal errors as soon as possible.
    5255wp_register_fatal_error_handler();
    53 
    54 // Check for the required PHP version and for the MySQL extension or a database drop-in.
    55 wp_check_php_mysql_versions();
    5656
    5757// WordPress calculates offsets from UTC.
Note: See TracChangeset for help on using the changeset viewer.