Changeset 6434
- Timestamp:
- 12/20/2007 08:44:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-settings.php
r6387 r6434 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') ) … … 23 41 unset( $wp_filter, $wp_action, $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; … … 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; … … 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; … … 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 … … 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 … … 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.4 284 */ 192 285 if ( !defined('AUTH_COOKIE') ) 193 286 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); 287 288 /** 289 * It is possible to define this in wp-config.php 290 * @since 2.3 291 */ 194 292 if ( !defined('TEST_COOKIE') ) 195 293 define('TEST_COOKIE', 'wordpress_test_cookie'); 294 295 /** 296 * It is possible to define this in wp-config.php 297 * @since 2.0 298 */ 196 299 if ( !defined('COOKIEPATH') ) 197 300 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 */ 198 306 if ( !defined('SITECOOKIEPATH') ) 199 307 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 */ 200 313 if ( !defined('COOKIE_DOMAIN') ) 201 314 define('COOKIE_DOMAIN', false); … … 241 354 do_action('sanitize_comment_cookies'); 242 355 356 /** 357 * WordPress Query object 358 * @global object $wp_the_query 359 * @since 2.0 360 */ 243 361 $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 */ 244 369 $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 */ 245 376 $wp_rewrite =& new WP_Rewrite(); 377 378 /** 379 * WordPress Object 380 * @global object $wp 381 * @since 2.0 382 */ 246 383 $wp =& new WP(); 247 384 385 386 /** 387 * Web Path to the current active template directory 388 * @since 1.5 389 */ 248 390 define('TEMPLATEPATH', get_template_directory()); 391 392 /** 393 * Web Path to the current active template stylesheet directory 394 * @since 2.1 395 */ 249 396 define('STYLESHEETPATH', get_stylesheet_directory()); 250 397 … … 260 407 require_once(ABSPATH . WPINC . '/locale.php'); 261 408 409 /** 410 * WordPress Locale object for loading locale domain date and various strings. 411 * @global object $wp_locale 412 * @since 2.1 413 */ 262 414 $wp_locale =& new WP_Locale(); 263 415 … … 268 420 include(TEMPLATEPATH . '/functions.php'); 269 421 422 /** 423 * Runs just before PHP shuts down execution. 424 * 425 * @access private 426 * @package WordPress 427 * @since 1.5 428 */ 270 429 function shutdown_action_hook() { 271 430 do_action('shutdown');
Note: See TracChangeset
for help on using the changeset viewer.