WordPress.org

Make WordPress Core

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

File wp-settings.phpdoc.4.diff, 7.3 KB (added by darkdragon, 7 years ago)

Added @Since to two missing blocks

  • wp-settings.php

     
    11<?php 
    2 // Turn register globals off 
     2/** 
     3 * wp-settings.php is 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_userdata, $cache_lastcommentmodified, $cache_lastpostdate, $cache_settings, $category_cache, $cache_categories ); 
    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 * @global int $timestart Seconds and Microseconds added together from when timer_start() is called 
     134 * @global int $timeend  Seconds and Microseconds added together from when function is called 
     135 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time 
     136 * @param int $precision The amount of digits from the right of the decimal to display. Default is 3. 
     137 * @return float The "second.microsecond" finished time calculation 
     138 * @since 1.5 
     139 */ 
    82140function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal 
    83141        global $timestart, $timeend; 
    84142        $mtime = microtime(); 
     
    104162if ( defined('WP_CACHE') ) 
    105163        @include ABSPATH . 'wp-content/advanced-cache.php'; 
    106164 
     165/** 
     166 * Stores the location of the WordPress directory of functions, classes, and core content. 
     167 * 
     168 * @since 1.5 
     169 */ 
    107170define('WPINC', 'wp-includes'); 
    108171 
    109172if ( !defined('LANGDIR') ) { 
     173        /** 
     174         * Stores the location of the language directory. First looks for language folder in wp-content  
     175         * and uses that folder if it exists. Or it uses the "languages" folder in WPINC. 
     176         * 
     177         * @since 1.5 
     178         */ 
    110179        if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') ) 
    111180                define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash 
    112181        else 
    113182                define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash 
    114183} 
    115184 
     185/** 
     186 * Allows for the plugins directory to be moved from the default location. 
     187 * 
     188 * @since 2.1 
     189 */ 
    116190if ( !defined('PLUGINDIR') ) 
    117191        define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash 
    118192 
     
    120194require (ABSPATH . WPINC . '/functions.php'); 
    121195 
    122196require_wp_db(); 
    123 // $table_prefix is deprecated as of 2.1 
     197 
     198/** 
     199 * @global string $table_prefix 
     200 * @since 1.5 
     201 * @deprecated 2.1 
     202 */ 
    124203$wpdb->prefix = $table_prefix; 
    125204 
    126205if ( preg_match('|[^a-z0-9_]|i', $wpdb->prefix) && !file_exists(ABSPATH . 'wp-content/db.php') ) 
     
    201280require (ABSPATH . WPINC . '/canonical.php'); 
    202281 
    203282if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) { 
    204     // Used to guarantee unique hash cookies 
    205     $cookiehash = md5(get_option('siteurl')); 
     283        // Used to guarantee unique hash cookies 
     284        $cookiehash = md5(get_option('siteurl')); 
     285        /** 
     286         * Used to guarantee unique hash cookies 
     287         * @since 1.5 
     288         */ 
    206289        define('COOKIEHASH', $cookiehash); 
    207290} 
    208291 
     292/** 
     293 * It is possible to define this in wp-config.php 
     294 * @since 2.0 
     295 */ 
    209296if ( !defined('USER_COOKIE') ) 
    210297        define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH); 
     298 
     299/** 
     300 * It is possible to define this in wp-config.php 
     301 * @since 2.0 
     302 */ 
    211303if ( !defined('PASS_COOKIE') ) 
    212304        define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH); 
     305 
     306/** 
     307 * It is possible to define this in wp-config.php 
     308 * @since 2.0 
     309 */ 
    213310if ( !defined('TEST_COOKIE') ) 
    214311        define('TEST_COOKIE', 'wordpress_test_cookie'); 
     312 
     313/** 
     314 * It is possible to define this in wp-config.php 
     315 * @since 2.0 
     316 */ 
    215317if ( !defined('COOKIEPATH') ) 
    216318        define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); 
     319 
     320/** 
     321 * It is possible to define this in wp-config.php 
     322 * @since 2.0 
     323 */ 
    217324if ( !defined('SITECOOKIEPATH') ) 
    218325        define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); 
     326 
     327/** 
     328 * It is possible to define this in wp-config.php 
     329 * @since 2.0 
     330 */ 
    219331if ( !defined('COOKIE_DOMAIN') ) 
    220332        define('COOKIE_DOMAIN', false); 
    221333 
     
    259371 
    260372do_action('sanitize_comment_cookies'); 
    261373 
     374/** 
     375 * Redundant WordPress Query object 
     376 * @global object $wp_the_query 
     377 * @since 2.0 
     378 */ 
    262379$wp_the_query =& new WP_Query(); 
     380 
     381/** 
     382 * Holds the reference to @see $wp_the_query 
     383 * Use this global for WordPress queries 
     384 * @global object $wp_query 
     385 * @since 2.0 
     386 */ 
    263387$wp_query     =& $wp_the_query; 
     388 
     389/** 
     390 * Holds the WordPress Rewrite object for creating pretty URLs 
     391 * @global object $wp_rewrite 
     392 * @since 2.0 
     393 */ 
    264394$wp_rewrite   =& new WP_Rewrite(); 
     395 
     396/** 
     397 * WordPress Object 
     398 * @global object $wp 
     399 * @since 2.0 
     400 */ 
    265401$wp           =& new WP(); 
    266402 
    267403validate_current_theme(); 
     404 
     405/** 
     406 * Web Path to the current active template directory 
     407 * @since 1.5 
     408 */ 
    268409define('TEMPLATEPATH', get_template_directory()); 
     410 
     411/** 
     412 * Web Path to the current active template stylesheet directory 
     413 * @since 2.1 
     414 */ 
    269415define('STYLESHEETPATH', get_stylesheet_directory()); 
    270416 
    271417// Load the default text localization domain. 
     
    279425// Pull in locale data after loading text domain. 
    280426require_once(ABSPATH . WPINC . '/locale.php'); 
    281427 
     428/** 
     429 * WordPress Locale object for loading locale domain date and various strings. 
     430 * @global object $wp_locale 
     431 * @since 2.1 
     432 */ 
    282433$wp_locale =& new WP_Locale(); 
    283434 
    284435// Load functions for active theme. 
     
    287438if ( file_exists(TEMPLATEPATH . '/functions.php') ) 
    288439        include(TEMPLATEPATH . '/functions.php'); 
    289440 
     441/** 
     442 * Runs just before PHP shuts down execution. 
     443 * 
     444 * @access private 
     445 * @package WordPress 
     446 * @since 1.5 
     447 */ 
    290448function shutdown_action_hook() { 
    291449        do_action('shutdown'); 
    292450        wp_cache_close(); 
     
    296454// Everything is loaded and initialized. 
    297455do_action('init'); 
    298456 
    299 ?> 
     457?> 
     458 No newline at end of file