phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
git-svn-id: https://develop.svn.wordpress.org/trunk@6434 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5e8f4ee900
commit
d476730696
161
wp-settings.php
161
wp-settings.php
@ -1,5 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
// Turn register globals off
|
/**
|
||||||
|
* Used to setup and fix common variables and include
|
||||||
|
* the WordPress procedural and class library.
|
||||||
|
*
|
||||||
|
* You should not have to change this file and allows for some configuration
|
||||||
|
* in wp-config.php.
|
||||||
|
*
|
||||||
|
* @package WordPress
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn register globals off
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @package WordPress
|
||||||
|
* @since 2.0
|
||||||
|
* @return null Will return null if register_globals PHP directive was disabled
|
||||||
|
*/
|
||||||
function wp_unregister_GLOBALS() {
|
function wp_unregister_GLOBALS() {
|
||||||
if ( !ini_get('register_globals') )
|
if ( !ini_get('register_globals') )
|
||||||
return;
|
return;
|
||||||
@ -22,6 +40,13 @@ wp_unregister_GLOBALS();
|
|||||||
|
|
||||||
unset( $wp_filter, $wp_action, $cache_lastcommentmodified, $cache_lastpostdate );
|
unset( $wp_filter, $wp_action, $cache_lastcommentmodified, $cache_lastpostdate );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The $blog_id global, which you can change in the config allows you to create a simple
|
||||||
|
* multiple blog installation using just one WordPress and changing $blog_id around.
|
||||||
|
*
|
||||||
|
* @global int $blog_id
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
if ( ! isset($blog_id) )
|
if ( ! isset($blog_id) )
|
||||||
$blog_id = 1;
|
$blog_id = 1;
|
||||||
|
|
||||||
@ -71,6 +96,15 @@ if ( version_compare( '4.2', phpversion(), '>' ) ) {
|
|||||||
if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') )
|
if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') )
|
||||||
die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' );
|
die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP 4 standard microtime start capture
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @package WordPress
|
||||||
|
* @global int $timestart Seconds and Microseconds added together from when function is called
|
||||||
|
* @return bool Always returns true
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
function timer_start() {
|
function timer_start() {
|
||||||
global $timestart;
|
global $timestart;
|
||||||
$mtime = explode(' ', microtime() );
|
$mtime = explode(' ', microtime() );
|
||||||
@ -79,6 +113,31 @@ function timer_start() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return and/or display the time from the page start to when function is called.
|
||||||
|
*
|
||||||
|
* You can get the results and print them by doing:
|
||||||
|
* <code>
|
||||||
|
* $nTimePageTookToExecute = timer_stop();
|
||||||
|
* echo $nTimePageTookToExecute;
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* Or instead, you can do:
|
||||||
|
* <code>
|
||||||
|
* timer_stop(1);
|
||||||
|
* </code>
|
||||||
|
* which will do what the above does. If you need the result, you can assign it to a variable, but
|
||||||
|
* most cases, you only need to echo it.
|
||||||
|
*
|
||||||
|
* @package WordPress
|
||||||
|
* @since 1.5
|
||||||
|
* @global int $timestart Seconds and Microseconds added together from when timer_start() is called
|
||||||
|
* @global int $timeend Seconds and Microseconds added together from when function is called
|
||||||
|
*
|
||||||
|
* @param int $display Use '0' or null to not echo anything and 1 to echo the total time
|
||||||
|
* @param int $precision The amount of digits from the right of the decimal to display. Default is 3.
|
||||||
|
* @return float The "second.microsecond" finished time calculation
|
||||||
|
*/
|
||||||
function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
|
function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
|
||||||
global $timestart, $timeend;
|
global $timestart, $timeend;
|
||||||
$mtime = microtime();
|
$mtime = microtime();
|
||||||
@ -104,15 +163,31 @@ if (defined('WP_DEBUG') and WP_DEBUG == true) {
|
|||||||
if ( defined('WP_CACHE') )
|
if ( defined('WP_CACHE') )
|
||||||
@include ABSPATH . 'wp-content/advanced-cache.php';
|
@include ABSPATH . 'wp-content/advanced-cache.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores the location of the WordPress directory of functions, classes, and core content.
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
define('WPINC', 'wp-includes');
|
define('WPINC', 'wp-includes');
|
||||||
|
|
||||||
if ( !defined('LANGDIR') ) {
|
if ( !defined('LANGDIR') ) {
|
||||||
|
/**
|
||||||
|
* Stores the location of the language directory. First looks for language folder in wp-content
|
||||||
|
* and uses that folder if it exists. Or it uses the "languages" folder in WPINC.
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') )
|
if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') )
|
||||||
define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash
|
define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash
|
||||||
else
|
else
|
||||||
define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash
|
define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows for the plugins directory to be moved from the default location.
|
||||||
|
*
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
if ( !defined('PLUGINDIR') )
|
if ( !defined('PLUGINDIR') )
|
||||||
define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
|
define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
|
||||||
|
|
||||||
@ -182,21 +257,59 @@ require (ABSPATH . WPINC . '/canonical.php');
|
|||||||
if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) {
|
if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) {
|
||||||
// Used to guarantee unique hash cookies
|
// Used to guarantee unique hash cookies
|
||||||
$cookiehash = md5(get_option('siteurl'));
|
$cookiehash = md5(get_option('siteurl'));
|
||||||
|
/**
|
||||||
|
* Used to guarantee unique hash cookies
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
define('COOKIEHASH', $cookiehash);
|
define('COOKIEHASH', $cookiehash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It is possible to define this in wp-config.php
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
if ( !defined('USER_COOKIE') )
|
if ( !defined('USER_COOKIE') )
|
||||||
define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
|
define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It is possible to define this in wp-config.php
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
if ( !defined('PASS_COOKIE') )
|
if ( !defined('PASS_COOKIE') )
|
||||||
define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
|
define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It is possible to define this in wp-config.php
|
||||||
|
* @since 2.4
|
||||||
|
*/
|
||||||
if ( !defined('AUTH_COOKIE') )
|
if ( !defined('AUTH_COOKIE') )
|
||||||
define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
|
define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It is possible to define this in wp-config.php
|
||||||
|
* @since 2.3
|
||||||
|
*/
|
||||||
if ( !defined('TEST_COOKIE') )
|
if ( !defined('TEST_COOKIE') )
|
||||||
define('TEST_COOKIE', 'wordpress_test_cookie');
|
define('TEST_COOKIE', 'wordpress_test_cookie');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It is possible to define this in wp-config.php
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
if ( !defined('COOKIEPATH') )
|
if ( !defined('COOKIEPATH') )
|
||||||
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
|
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It is possible to define this in wp-config.php
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
if ( !defined('SITECOOKIEPATH') )
|
if ( !defined('SITECOOKIEPATH') )
|
||||||
define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
|
define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It is possible to define this in wp-config.php
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
if ( !defined('COOKIE_DOMAIN') )
|
if ( !defined('COOKIE_DOMAIN') )
|
||||||
define('COOKIE_DOMAIN', false);
|
define('COOKIE_DOMAIN', false);
|
||||||
|
|
||||||
@ -240,12 +353,46 @@ $_SERVER = add_magic_quotes($_SERVER);
|
|||||||
|
|
||||||
do_action('sanitize_comment_cookies');
|
do_action('sanitize_comment_cookies');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress Query object
|
||||||
|
* @global object $wp_the_query
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
$wp_the_query =& new WP_Query();
|
$wp_the_query =& new WP_Query();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds the reference to @see $wp_the_query
|
||||||
|
* Use this global for WordPress queries
|
||||||
|
* @global object $wp_query
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
$wp_query =& $wp_the_query;
|
$wp_query =& $wp_the_query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds the WordPress Rewrite object for creating pretty URLs
|
||||||
|
* @global object $wp_rewrite
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
$wp_rewrite =& new WP_Rewrite();
|
$wp_rewrite =& new WP_Rewrite();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress Object
|
||||||
|
* @global object $wp
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
$wp =& new WP();
|
$wp =& new WP();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web Path to the current active template directory
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
define('TEMPLATEPATH', get_template_directory());
|
define('TEMPLATEPATH', get_template_directory());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web Path to the current active template stylesheet directory
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
define('STYLESHEETPATH', get_stylesheet_directory());
|
define('STYLESHEETPATH', get_stylesheet_directory());
|
||||||
|
|
||||||
// Load the default text localization domain.
|
// Load the default text localization domain.
|
||||||
@ -259,6 +406,11 @@ if ( is_readable($locale_file) )
|
|||||||
// Pull in locale data after loading text domain.
|
// Pull in locale data after loading text domain.
|
||||||
require_once(ABSPATH . WPINC . '/locale.php');
|
require_once(ABSPATH . WPINC . '/locale.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress Locale object for loading locale domain date and various strings.
|
||||||
|
* @global object $wp_locale
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
$wp_locale =& new WP_Locale();
|
$wp_locale =& new WP_Locale();
|
||||||
|
|
||||||
// Load functions for active theme.
|
// Load functions for active theme.
|
||||||
@ -267,6 +419,13 @@ if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions
|
|||||||
if ( file_exists(TEMPLATEPATH . '/functions.php') )
|
if ( file_exists(TEMPLATEPATH . '/functions.php') )
|
||||||
include(TEMPLATEPATH . '/functions.php');
|
include(TEMPLATEPATH . '/functions.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs just before PHP shuts down execution.
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @package WordPress
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
function shutdown_action_hook() {
|
function shutdown_action_hook() {
|
||||||
do_action('shutdown');
|
do_action('shutdown');
|
||||||
wp_cache_close();
|
wp_cache_close();
|
||||||
|
Loading…
Reference in New Issue
Block a user