Ticket #5211: wp-settings.phpdoc.4.diff
| File wp-settings.phpdoc.4.diff, 7.3 KB (added by , 18 years ago) |
|---|
-
wp-settings.php
1 1 <?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 */ 3 21 function wp_unregister_GLOBALS() { 4 22 if ( !ini_get('register_globals') ) 5 23 return; … … 22 40 23 41 unset( $wp_filter, $cache_userdata, $cache_lastcommentmodified, $cache_lastpostdate, $cache_settings, $category_cache, $cache_categories ); 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 * @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 */ 82 140 function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal 83 141 global $timestart, $timeend; 84 142 $mtime = microtime(); … … 104 162 if ( defined('WP_CACHE') ) 105 163 @include ABSPATH . 'wp-content/advanced-cache.php'; 106 164 165 /** 166 * Stores the location of the WordPress directory of functions, classes, and core content. 167 * 168 * @since 1.5 169 */ 107 170 define('WPINC', 'wp-includes'); 108 171 109 172 if ( !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 */ 110 179 if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') ) 111 180 define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash 112 181 else 113 182 define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash 114 183 } 115 184 185 /** 186 * Allows for the plugins directory to be moved from the default location. 187 * 188 * @since 2.1 189 */ 116 190 if ( !defined('PLUGINDIR') ) 117 191 define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash 118 192 … … 120 194 require (ABSPATH . WPINC . '/functions.php'); 121 195 122 196 require_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 */ 124 203 $wpdb->prefix = $table_prefix; 125 204 126 205 if ( preg_match('|[^a-z0-9_]|i', $wpdb->prefix) && !file_exists(ABSPATH . 'wp-content/db.php') ) … … 201 280 require (ABSPATH . WPINC . '/canonical.php'); 202 281 203 282 if (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 */ 206 289 define('COOKIEHASH', $cookiehash); 207 290 } 208 291 292 /** 293 * It is possible to define this in wp-config.php 294 * @since 2.0 295 */ 209 296 if ( !defined('USER_COOKIE') ) 210 297 define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH); 298 299 /** 300 * It is possible to define this in wp-config.php 301 * @since 2.0 302 */ 211 303 if ( !defined('PASS_COOKIE') ) 212 304 define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH); 305 306 /** 307 * It is possible to define this in wp-config.php 308 * @since 2.0 309 */ 213 310 if ( !defined('TEST_COOKIE') ) 214 311 define('TEST_COOKIE', 'wordpress_test_cookie'); 312 313 /** 314 * It is possible to define this in wp-config.php 315 * @since 2.0 316 */ 215 317 if ( !defined('COOKIEPATH') ) 216 318 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 */ 217 324 if ( !defined('SITECOOKIEPATH') ) 218 325 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 */ 219 331 if ( !defined('COOKIE_DOMAIN') ) 220 332 define('COOKIE_DOMAIN', false); 221 333 … … 259 371 260 372 do_action('sanitize_comment_cookies'); 261 373 374 /** 375 * Redundant WordPress Query object 376 * @global object $wp_the_query 377 * @since 2.0 378 */ 262 379 $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 */ 263 387 $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 */ 264 394 $wp_rewrite =& new WP_Rewrite(); 395 396 /** 397 * WordPress Object 398 * @global object $wp 399 * @since 2.0 400 */ 265 401 $wp =& new WP(); 266 402 267 403 validate_current_theme(); 404 405 /** 406 * Web Path to the current active template directory 407 * @since 1.5 408 */ 268 409 define('TEMPLATEPATH', get_template_directory()); 410 411 /** 412 * Web Path to the current active template stylesheet directory 413 * @since 2.1 414 */ 269 415 define('STYLESHEETPATH', get_stylesheet_directory()); 270 416 271 417 // Load the default text localization domain. … … 279 425 // Pull in locale data after loading text domain. 280 426 require_once(ABSPATH . WPINC . '/locale.php'); 281 427 428 /** 429 * WordPress Locale object for loading locale domain date and various strings. 430 * @global object $wp_locale 431 * @since 2.1 432 */ 282 433 $wp_locale =& new WP_Locale(); 283 434 284 435 // Load functions for active theme. … … 287 438 if ( file_exists(TEMPLATEPATH . '/functions.php') ) 288 439 include(TEMPLATEPATH . '/functions.php'); 289 440 441 /** 442 * Runs just before PHP shuts down execution. 443 * 444 * @access private 445 * @package WordPress 446 * @since 1.5 447 */ 290 448 function shutdown_action_hook() { 291 449 do_action('shutdown'); 292 450 wp_cache_close(); … … 296 454 // Everything is loaded and initialized. 297 455 do_action('init'); 298 456 299 ?> 457 ?> 458 No newline at end of file