Ticket #5211: wp-settings.phpdoc.r6311.diff
File wp-settings.phpdoc.r6311.diff, 6.8 KB (added by , 16 years ago) |
---|
-
wp-settings.php
1 1 <?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 */ 3 21 function wp_unregister_GLOBALS() { 4 22 if ( !ini_get('register_globals') ) 5 23 return; … … 22 40 23 41 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); 24 42 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 */ 25 50 if ( ! isset($blog_id) ) 26 51 $blog_id = 1; 27 52 … … 71 96 if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') ) 72 97 die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' ); 73 98 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 */ 74 108 function timer_start() { 75 109 global $timestart; 76 110 $mtime = explode(' ', microtime() ); … … 79 113 return true; 80 114 } 81 115 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 */ 82 141 function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal 83 142 global $timestart, $timeend; 84 143 $mtime = microtime(); … … 104 163 if ( defined('WP_CACHE') ) 105 164 @include ABSPATH . 'wp-content/advanced-cache.php'; 106 165 166 /** 167 * Stores the location of the WordPress directory of functions, classes, and core content. 168 * 169 * @since 1.5 170 */ 107 171 define('WPINC', 'wp-includes'); 108 172 109 173 if ( !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 */ 110 180 if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') ) 111 181 define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash 112 182 else 113 183 define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash 114 184 } 115 185 186 /** 187 * Allows for the plugins directory to be moved from the default location. 188 * 189 * @since 2.1 190 */ 116 191 if ( !defined('PLUGINDIR') ) 117 192 define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash 118 193 … … 180 255 require (ABSPATH . WPINC . '/canonical.php'); 181 256 182 257 if (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 */ 185 264 define('COOKIEHASH', $cookiehash); 186 265 } 187 266 267 /** 268 * It is possible to define this in wp-config.php 269 * @since 2.0 270 */ 188 271 if ( !defined('USER_COOKIE') ) 189 272 define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH); 273 274 /** 275 * It is possible to define this in wp-config.php 276 * @since 2.0 277 */ 190 278 if ( !defined('PASS_COOKIE') ) 191 279 define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH); 280 281 /** 282 * It is possible to define this in wp-config.php 283 * @since 2.0 284 */ 192 285 if ( !defined('TEST_COOKIE') ) 193 286 define('TEST_COOKIE', 'wordpress_test_cookie'); 287 288 /** 289 * It is possible to define this in wp-config.php 290 * @since 2.0 291 */ 194 292 if ( !defined('COOKIEPATH') ) 195 293 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 */ 196 299 if ( !defined('SITECOOKIEPATH') ) 197 300 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 */ 198 306 if ( !defined('COOKIE_DOMAIN') ) 199 307 define('COOKIE_DOMAIN', false); 200 308 … … 238 346 239 347 do_action('sanitize_comment_cookies'); 240 348 349 /** 350 * WordPress Query object 351 * @global object $wp_the_query 352 * @since 2.0 353 */ 241 354 $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 */ 242 362 $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 */ 243 369 $wp_rewrite =& new WP_Rewrite(); 370 371 /** 372 * WordPress Object 373 * @global object $wp 374 * @since 2.0 375 */ 244 376 $wp =& new WP(); 245 377 246 378 validate_current_theme(); 379 380 /** 381 * Web Path to the current active template directory 382 * @since 1.5 383 */ 247 384 define('TEMPLATEPATH', get_template_directory()); 385 386 /** 387 * Web Path to the current active template stylesheet directory 388 * @since 2.1 389 */ 248 390 define('STYLESHEETPATH', get_stylesheet_directory()); 249 391 250 392 // Load the default text localization domain. … … 258 400 // Pull in locale data after loading text domain. 259 401 require_once(ABSPATH . WPINC . '/locale.php'); 260 402 403 /** 404 * WordPress Locale object for loading locale domain date and various strings. 405 * @global object $wp_locale 406 * @since 2.1 407 */ 261 408 $wp_locale =& new WP_Locale(); 262 409 263 410 // Load functions for active theme. … … 266 413 if ( file_exists(TEMPLATEPATH . '/functions.php') ) 267 414 include(TEMPLATEPATH . '/functions.php'); 268 415 416 /** 417 * Runs just before PHP shuts down execution. 418 * 419 * @access private 420 * @package WordPress 421 * @since 1.5 422 */ 269 423 function shutdown_action_hook() { 270 424 do_action('shutdown'); 271 425 wp_cache_close();