Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r47088 r47122  
    3636    }
    3737
    38     // Variables that shouldn't be unset
     38    // Variables that shouldn't be unset.
    3939    $no_unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix' );
    4040
     
    6666    $_SERVER = array_merge( $default_server_values, $_SERVER );
    6767
    68     // Fix for IIS when running with PHP ISAPI
     68    // Fix for IIS when running with PHP ISAPI.
    6969    if ( empty( $_SERVER['REQUEST_URI'] ) || ( PHP_SAPI != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
    7070
    7171        if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
    72             // IIS Mod-Rewrite
     72            // IIS Mod-Rewrite.
    7373            $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
    7474        } elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {
    75             // IIS Isapi_Rewrite
     75            // IIS Isapi_Rewrite.
    7676            $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
    7777        } else {
    78             // Use ORIG_PATH_INFO if there is no PATH_INFO
     78            // Use ORIG_PATH_INFO if there is no PATH_INFO.
    7979            if ( ! isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) ) {
    8080                $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
    8181            }
    8282
    83             // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
     83            // Some IIS + PHP configurations put the script-name in the path-info (no need to append it twice).
    8484            if ( isset( $_SERVER['PATH_INFO'] ) ) {
    8585                if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) {
     
    9090            }
    9191
    92             // Append the query string if it exists and isn't null
     92            // Append the query string if it exists and isn't null.
    9393            if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
    9494                $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
     
    9797    }
    9898
    99     // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
     99    // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests.
    100100    if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) ) {
    101101        $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
    102102    }
    103103
    104     // Fix for Dreamhost and other PHP as CGI hosts
     104    // Fix for Dreamhost and other PHP as CGI hosts.
    105105    if ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) {
    106106        unset( $_SERVER['PATH_INFO'] );
    107107    }
    108108
    109     // Fix empty PHP_SELF
     109    // Fix empty PHP_SELF.
    110110    $PHP_SELF = $_SERVER['PHP_SELF'];
    111111    if ( empty( $PHP_SELF ) ) {
     
    472472        'comment_karma'    => '%d',
    473473        'comment_count'    => '%d',
    474         // multisite:
     474        // Multisite:
    475475        'active'           => '%d',
    476476        'cat_id'           => '%d',
     
    550550                }
    551551
    552                 // Re-initialize any hooks added manually by object-cache.php
     552                // Re-initialize any hooks added manually by object-cache.php.
    553553                if ( $wp_filter ) {
    554554                    $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter );
     
    667667    $active_plugins = (array) get_option( 'active_plugins', array() );
    668668
    669     // Check for hacks file if the option is enabled
     669    // Check for hacks file if the option is enabled.
    670670    if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) {
    671671        _deprecated_file( 'my-hacks.php', '1.5.0' );
     
    680680
    681681    foreach ( $active_plugins as $plugin ) {
    682         if ( ! validate_file( $plugin ) // $plugin must validate as file
    683             && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php'
    684             && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist
    685             // not already included as a network plugin
     682        if ( ! validate_file( $plugin )                     // $plugin must validate as file.
     683            && '.php' == substr( $plugin, -4 )              // $plugin must end with '.php'.
     684            && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist.
     685            // Not already included as a network plugin.
    686686            && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) )
    687687            ) {
     
    961961 */
    962962function wp_clone( $object ) {
    963     // Use parens for clone to accommodate PHP 4. See #17880
     963    // Use parens for clone to accommodate PHP 4. See #17880.
    964964    return clone( $object );
    965965}
     
    11501150    }
    11511151
    1152     // We need $wp_local_package
     1152    // We need $wp_local_package.
    11531153    require ABSPATH . WPINC . '/version.php';
    11541154
    1155     // Translation and localization
     1155    // Translation and localization.
    11561156    require_once ABSPATH . WPINC . '/pomo/mo.php';
    11571157    require_once ABSPATH . WPINC . '/l10n.php';
     
    11591159    require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php';
    11601160
    1161     // General libraries
     1161    // General libraries.
    11621162    require_once ABSPATH . WPINC . '/plugin.php';
    11631163
Note: See TracChangeset for help on using the changeset viewer.