Changeset 6434

Show
Ignore:
Timestamp:
12/20/07 20:44:52 (8 months ago)
Author:
westi
Message:

phpdoc for wp-settings.php. Fixes #5211 props darkdragon.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-settings.php

    r6387 r6434  
    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') ) 
     
    2341unset( $wp_filter, $wp_action, $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; 
     
    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; 
     
    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; 
     
    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 
     
    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 
     
    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.4 
     284 */ 
    192285if ( !defined('AUTH_COOKIE') ) 
    193286    define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); 
     287 
     288/** 
     289 * It is possible to define this in wp-config.php 
     290 * @since 2.3 
     291 */ 
    194292if ( !defined('TEST_COOKIE') ) 
    195293    define('TEST_COOKIE', 'wordpress_test_cookie'); 
     294 
     295/** 
     296 * It is possible to define this in wp-config.php 
     297 * @since 2.0 
     298 */ 
    196299if ( !defined('COOKIEPATH') ) 
    197300    define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); 
     301 
     302/** 
     303 * It is possible to define this in wp-config.php 
     304 * @since 2.0 
     305 */ 
    198306if ( !defined('SITECOOKIEPATH') ) 
    199307    define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); 
     308 
     309/** 
     310 * It is possible to define this in wp-config.php 
     311 * @since 2.0 
     312 */ 
    200313if ( !defined('COOKIE_DOMAIN') ) 
    201314    define('COOKIE_DOMAIN', false); 
     
    241354do_action('sanitize_comment_cookies'); 
    242355 
     356/** 
     357 * WordPress Query object 
     358 * @global object $wp_the_query 
     359 * @since 2.0 
     360 */ 
    243361$wp_the_query =& new WP_Query(); 
     362 
     363/** 
     364 * Holds the reference to @see $wp_the_query 
     365 * Use this global for WordPress queries 
     366 * @global object $wp_query 
     367 * @since 2.0 
     368 */ 
    244369$wp_query     =& $wp_the_query; 
     370 
     371/** 
     372 * Holds the WordPress Rewrite object for creating pretty URLs 
     373 * @global object $wp_rewrite 
     374 * @since 2.0 
     375 */ 
    245376$wp_rewrite   =& new WP_Rewrite(); 
     377 
     378/** 
     379 * WordPress Object 
     380 * @global object $wp 
     381 * @since 2.0 
     382 */ 
    246383$wp           =& new WP(); 
    247384 
     385 
     386/** 
     387 * Web Path to the current active template directory 
     388 * @since 1.5 
     389 */ 
    248390define('TEMPLATEPATH', get_template_directory()); 
     391 
     392/** 
     393 * Web Path to the current active template stylesheet directory 
     394 * @since 2.1 
     395 */ 
    249396define('STYLESHEETPATH', get_stylesheet_directory()); 
    250397 
     
    260407require_once(ABSPATH . WPINC . '/locale.php'); 
    261408 
     409/** 
     410 * WordPress Locale object for loading locale domain date and various strings. 
     411 * @global object $wp_locale 
     412 * @since 2.1 
     413 */ 
    262414$wp_locale =& new WP_Locale(); 
    263415 
     
    268420    include(TEMPLATEPATH . '/functions.php'); 
    269421 
     422/** 
     423 * Runs just before PHP shuts down execution. 
     424 * 
     425 * @access private 
     426 * @package WordPress 
     427 * @since 1.5 
     428 */ 
    270429function shutdown_action_hook() { 
    271430    do_action('shutdown');