Make WordPress Core

Ticket #5211: wp-settings.phpdoc.r6311.diff

File wp-settings.phpdoc.r6311.diff, 6.8 KB (added by darkdragon, 18 years ago)

Updated previous patch for r6311, which caused conflicts.

  • wp-settings.php

     
    11<?php
    2 // Turn register globals off
     2/**
     3 * Used to setup and fix common variables and include
     4 * the WordPress procedural and class library.
     5 *
     6 * You should not have to change this file and allows for some configuration
     7 * in wp-config.php.
     8 *
     9 * @package WordPress
     10 * @since 1.5
     11 */
     12
     13/**
     14 * Turn register globals off
     15 *
     16 * @access private
     17 * @package WordPress
     18 * @since 2.0
     19 * @return null Will return null if register_globals PHP directive was disabled
     20 */
    321function wp_unregister_GLOBALS() {
    422        if ( !ini_get('register_globals') )
    523                return;
     
    2240
    2341unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );
    2442
     43/**
     44 * The $blog_id global, which you can change in the config allows you to create a simple
     45 * multiple blog installation using just one WordPress and changing $blog_id around.
     46 *
     47 * @global int $blog_id
     48 * @since 2.0
     49 */
    2550if ( ! isset($blog_id) )
    2651        $blog_id = 1;
    2752
     
    7196if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') )
    7297        die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' );
    7398
     99/**
     100 * PHP 4 standard microtime start capture
     101 *
     102 * @access private
     103 * @package WordPress
     104 * @global int $timestart Seconds and Microseconds added together from when function is called
     105 * @return bool Always returns true
     106 * @since 1.5
     107 */
    74108function timer_start() {
    75109        global $timestart;
    76110        $mtime = explode(' ', microtime() );
     
    79113        return true;
    80114}
    81115
     116/**
     117 * Return and/or display the time from the page start to when function is called.
     118 *
     119 * You can get the results and print them by doing:
     120 * <code>
     121 * $nTimePageTookToExecute = timer_stop();
     122 * echo $nTimePageTookToExecute;
     123 * </code>
     124 *
     125 * Or instead, you can do:
     126 * <code>
     127 * timer_stop(1);
     128 * </code>
     129 * which will do what the above does. If you need the result, you can assign it to a variable, but
     130 * most cases, you only need to echo it.
     131 *
     132 * @package WordPress
     133 * @since 1.5
     134 * @global int $timestart Seconds and Microseconds added together from when timer_start() is called
     135 * @global int $timeend  Seconds and Microseconds added together from when function is called
     136 *
     137 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time
     138 * @param int $precision The amount of digits from the right of the decimal to display. Default is 3.
     139 * @return float The "second.microsecond" finished time calculation
     140 */
    82141function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
    83142        global $timestart, $timeend;
    84143        $mtime = microtime();
     
    104163if ( defined('WP_CACHE') )
    105164        @include ABSPATH . 'wp-content/advanced-cache.php';
    106165
     166/**
     167 * Stores the location of the WordPress directory of functions, classes, and core content.
     168 *
     169 * @since 1.5
     170 */
    107171define('WPINC', 'wp-includes');
    108172
    109173if ( !defined('LANGDIR') ) {
     174        /**
     175         * Stores the location of the language directory. First looks for language folder in wp-content
     176         * and uses that folder if it exists. Or it uses the "languages" folder in WPINC.
     177         *
     178         * @since 1.5
     179         */
    110180        if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') )
    111181                define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash
    112182        else
    113183                define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash
    114184}
    115185
     186/**
     187 * Allows for the plugins directory to be moved from the default location.
     188 *
     189 * @since 2.1
     190 */
    116191if ( !defined('PLUGINDIR') )
    117192        define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
    118193
     
    180255require (ABSPATH . WPINC . '/canonical.php');
    181256
    182257if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) {
    183     // Used to guarantee unique hash cookies
    184     $cookiehash = md5(get_option('siteurl'));
     258        // Used to guarantee unique hash cookies
     259        $cookiehash = md5(get_option('siteurl'));
     260        /**
     261         * Used to guarantee unique hash cookies
     262         * @since 1.5
     263         */
    185264        define('COOKIEHASH', $cookiehash);
    186265}
    187266
     267/**
     268 * It is possible to define this in wp-config.php
     269 * @since 2.0
     270 */
    188271if ( !defined('USER_COOKIE') )
    189272        define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH);
     273
     274/**
     275 * It is possible to define this in wp-config.php
     276 * @since 2.0
     277 */
    190278if ( !defined('PASS_COOKIE') )
    191279        define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH);
     280
     281/**
     282 * It is possible to define this in wp-config.php
     283 * @since 2.0
     284 */
    192285if ( !defined('TEST_COOKIE') )
    193286        define('TEST_COOKIE', 'wordpress_test_cookie');
     287
     288/**
     289 * It is possible to define this in wp-config.php
     290 * @since 2.0
     291 */
    194292if ( !defined('COOKIEPATH') )
    195293        define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
     294
     295/**
     296 * It is possible to define this in wp-config.php
     297 * @since 2.0
     298 */
    196299if ( !defined('SITECOOKIEPATH') )
    197300        define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
     301
     302/**
     303 * It is possible to define this in wp-config.php
     304 * @since 2.0
     305 */
    198306if ( !defined('COOKIE_DOMAIN') )
    199307        define('COOKIE_DOMAIN', false);
    200308
     
    238346
    239347do_action('sanitize_comment_cookies');
    240348
     349/**
     350 * WordPress Query object
     351 * @global object $wp_the_query
     352 * @since 2.0
     353 */
    241354$wp_the_query =& new WP_Query();
     355
     356/**
     357 * Holds the reference to @see $wp_the_query
     358 * Use this global for WordPress queries
     359 * @global object $wp_query
     360 * @since 2.0
     361 */
    242362$wp_query     =& $wp_the_query;
     363
     364/**
     365 * Holds the WordPress Rewrite object for creating pretty URLs
     366 * @global object $wp_rewrite
     367 * @since 2.0
     368 */
    243369$wp_rewrite   =& new WP_Rewrite();
     370
     371/**
     372 * WordPress Object
     373 * @global object $wp
     374 * @since 2.0
     375 */
    244376$wp           =& new WP();
    245377
    246378validate_current_theme();
     379
     380/**
     381 * Web Path to the current active template directory
     382 * @since 1.5
     383 */
    247384define('TEMPLATEPATH', get_template_directory());
     385
     386/**
     387 * Web Path to the current active template stylesheet directory
     388 * @since 2.1
     389 */
    248390define('STYLESHEETPATH', get_stylesheet_directory());
    249391
    250392// Load the default text localization domain.
     
    258400// Pull in locale data after loading text domain.
    259401require_once(ABSPATH . WPINC . '/locale.php');
    260402
     403/**
     404 * WordPress Locale object for loading locale domain date and various strings.
     405 * @global object $wp_locale
     406 * @since 2.1
     407 */
    261408$wp_locale =& new WP_Locale();
    262409
    263410// Load functions for active theme.
     
    266413if ( file_exists(TEMPLATEPATH . '/functions.php') )
    267414        include(TEMPLATEPATH . '/functions.php');
    268415
     416/**
     417 * Runs just before PHP shuts down execution.
     418 *
     419 * @access private
     420 * @package WordPress
     421 * @since 1.5
     422 */
    269423function shutdown_action_hook() {
    270424        do_action('shutdown');
    271425        wp_cache_close();