Make WordPress Core


Ignore:
Timestamp:
09/19/2019 12:01:03 PM (5 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-includes/load.php

    r46105 r46183  
    132132
    133133    if ( version_compare( $required_php_version, $php_version, '>' ) ) {
    134         wp_load_translations_early();
    135 
    136134        $protocol = wp_get_server_protocol();
    137135        header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
    138136        header( 'Content-Type: text/html; charset=utf-8' );
    139         /* translators: 1: Current PHP version number, 2: WordPress version number, 3: Minimum required PHP version number. */
    140         printf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version );
     137        printf( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.', $php_version, $wp_version, $required_php_version );
    141138        exit( 1 );
    142139    }
Note: See TracChangeset for help on using the changeset viewer.