Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 444 lines (380 sloc) 13.472 kb
0bc86133 » mikelittle
2003-06-12 b2config.php replaced with wp-config.sample.php
1 <?php
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
2 /**
3 * Used to setup and fix common variables and include
4 * the WordPress procedural and class library.
5 *
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
6 * You should not have to change this file and allows
7 * for some configuration in wp-config.php.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
8 *
9 * @package WordPress
10 */
11
12 /**
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
13 * wp_unregister_GLOBALS() - Turn register globals off
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
14 *
15 * @access private
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
16 * @since 2.1.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
17 * @return null Will return null if register_globals PHP directive was disabled
18 */
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
19 function wp_unregister_GLOBALS() {
20 if ( !ini_get('register_globals') )
21 return;
dce5220c » matt
2005-08-15 Typos and more secure unsetting. Hat tip: Stefen Esser
22
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
23 if ( isset($_REQUEST['GLOBALS']) )
24 die('GLOBALS overwrite attempt detected');
25
26 // Variables that shouldn't be unset
27 $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix');
28
29 $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
321c3107 » ryan
2007-09-03 Remove trailing whitespace
30 foreach ( $input as $k => $v )
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
31 if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) {
9323d394 » ryan
2007-01-11 Zend hash del key or index fix. PRops MarkJaquith.
32 $GLOBALS[$k] = NULL;
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
33 unset($GLOBALS[$k]);
9323d394 » ryan
2007-01-11 Zend hash del key or index fix. PRops MarkJaquith.
34 }
2919fe29 » matt
2005-08-09 That last thing didn't work at all.
35 }
877e6a71 » matt
2005-08-09 Turn register globals off. Hat tip: Christian Schmidt
36
321c3107 » ryan
2007-09-03 Remove trailing whitespace
37 wp_unregister_GLOBALS();
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
38
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
39 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );
376ec4dc » matt
2005-08-09 Tweak
40
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
41 /**
42 * The $blog_id global, which you can change in the config allows you to create a simple
43 * multiple blog installation using just one WordPress and changing $blog_id around.
44 *
45 * @global int $blog_id
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
46 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
47 */
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
48 if ( ! isset($blog_id) )
85723b89 » ryan
2005-11-07 Object caching, round one.
49 $blog_id = 1;
50
a18a23e8 » saxmatt
2004-02-10 Work around IIS' lack of REQUEST_URI
51 // Fix for IIS, which doesn't set REQUEST_URI
40a7d9d2 » matt
2005-08-03 Fixes #1488
52 if ( empty( $_SERVER['REQUEST_URI'] ) ) {
dd202ce1 » ryan
2006-02-12 Death to trailing tabs. Props Mark J. fixes #2405
53
54639a39 » markjaquith
2007-08-17 Set REQUEST_URI for IIS in more situations. props snakefoot. fixes #3514
54 // IIS Mod-Rewrite
55 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
56 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
57 }
58 // IIS Isapi_Rewrite
59 else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
60 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
61 }
c698c971 » markjaquith
2007-10-09 IIS REQUEST_URI-setting fixes from snakefoot. fixes #5160 for trunk
62 else
63 {
64 // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
65 if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
6a1c63e2 » markjaquith
2007-09-07 Correctly set REQUEST_URI for IIS setups that put that info into SCRI…
66 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
54639a39 » markjaquith
2007-08-17 Set REQUEST_URI for IIS in more situations. props snakefoot. fixes #3514
67 else
68 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
87c4f3a1 » ryan
2007-09-03 Strip lines that contain only whitespace down to newlines.
69
54639a39 » markjaquith
2007-08-17 Set REQUEST_URI for IIS in more situations. props snakefoot. fixes #3514
70 // Append the query string if it exists and isn't null
71 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
72 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
73 }
720316dd » rboren
2004-10-26 Do not touch REQUEST_URI if it is already set by the server.
74 }
12b40694 » rboren
2004-10-22 Fix REQUEST_URI construction for IIS. Bug 389. Patch from Dennis Will…
75 }
a18a23e8 » saxmatt
2004-02-10 Work around IIS' lack of REQUEST_URI
76
c50e7da2 » matt
2005-11-10 Fixes #1591 (again)
77 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
c1ed565c » ryan
2006-01-06 Check if SCRIPT_FILENAME is set to avoid warnings. fixes #2227
78 if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) )
c50e7da2 » matt
2005-11-10 Fixes #1591 (again)
79 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
80
885ee8f9 » matt
2005-11-14 This should fix permalinks, but may break the PHP as CGI funkiness again
81 // Fix for Dreamhost and other PHP as CGI hosts
3320dd13 » markjaquith
2007-03-07 Use strpos instead of strstr where ever possible, for speed. Props ro…
82 if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false)
c50e7da2 » matt
2005-11-10 Fixes #1591 (again)
83 unset($_SERVER['PATH_INFO']);
84
38f4fca0 » ryan
2005-12-29 Move PHP_SELF setup to wp-settings.php. #2153
85 // Fix empty PHP_SELF
86 $PHP_SELF = $_SERVER['PHP_SELF'];
87 if ( empty($PHP_SELF) )
88 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
885ee8f9 » matt
2005-11-14 This should fix permalinks, but may break the PHP as CGI funkiness again
89
629dde86 » rob1n
2007-05-25 Actually check for PHP 4.2. Props nbachiyski. fixes #4336
90 if ( version_compare( '4.2', phpversion(), '>' ) ) {
91 die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.2.' );
92 }
da4a0d98 » saxmatt
2004-08-10 Fix for empty plugin strings, class include moved for timing.
93
172bfb80 » ryan
2006-11-19 Don't enforce presence of mysql system if custom DB class is being us…
94 if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') )
fa1ec4ea » ryan
2006-08-05 Don't wp_die() before functions.php is loaded.
95 die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' );
0d040b30 » saxmatt
2004-12-14 Sanity check mysql.
96
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
97 /**
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
98 * timer_start() - PHP 4 standard microtime start capture
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
99 *
100 * @access private
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
101 * @since 0.71
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
102 * @global int $timestart Seconds and Microseconds added together from when function is called
103 * @return bool Always returns true
104 */
551e52ff » saxmatt
2004-10-04 Code cleanup and some fixes from the WP Japan folks.
105 function timer_start() {
106 global $timestart;
107 $mtime = explode(' ', microtime() );
108 $mtime = $mtime[1] + $mtime[0];
109 $timestart = $mtime;
110 return true;
111 }
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
112
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
113 /**
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
114 * timer_stop() - Return and/or display the time from the page start to when function is called.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
115 *
116 * You can get the results and print them by doing:
117 * <code>
118 * $nTimePageTookToExecute = timer_stop();
119 * echo $nTimePageTookToExecute;
120 * </code>
121 *
122 * Or instead, you can do:
123 * <code>
124 * timer_stop(1);
125 * </code>
126 * which will do what the above does. If you need the result, you can assign it to a variable, but
127 * most cases, you only need to echo it.
128 *
6950e283 » westi
2007-12-20 Fix @since for timer_start and timer_stop. See #5211.
129 * @since 0.71
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
130 * @global int $timestart Seconds and Microseconds added together from when timer_start() is called
131 * @global int $timeend Seconds and Microseconds added together from when function is called
132 *
133 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time
134 * @param int $precision The amount of digits from the right of the decimal to display. Default is 3.
135 * @return float The "second.microsecond" finished time calculation
136 */
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
137 function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
138 global $timestart, $timeend;
139 $mtime = microtime();
140 $mtime = explode(' ',$mtime);
141 $mtime = $mtime[1] + $mtime[0];
142 $timeend = $mtime;
143 $timetotal = $timeend-$timestart;
4f6b825b » markjaquith
2007-09-19 Make sure number_format_i18n() is available before calling it in time…
144 $r = ( function_exists('number_format_i18n') ) ? number_format_i18n($timetotal, $precision) : number_format($timetotal, $precision);
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
145 if ( $display )
a9d23d40 » markjaquith
2006-10-04 allow timer_stop() to use number_format() when returning. Props mdawa…
146 echo $r;
147 return $r;
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
148 }
551e52ff » saxmatt
2004-10-04 Code cleanup and some fixes from the WP Japan folks.
149 timer_start();
da4a0d98 » saxmatt
2004-08-10 Fix for empty plugin strings, class include moved for timing.
150
f3e26c6d » westi
2007-10-02 s/WPDEBUG/WP_DEBUG/g Fixes #5033
151 // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
152 if (defined('WP_DEBUG') and WP_DEBUG == true) {
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
153 error_reporting(E_ALL);
2bcddfc0 » westi
2007-09-30 Enable developers to turn on notices from wp-config.php. Relates #315…
154 } else {
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
155 error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
2bcddfc0 » westi
2007-09-30 Enable developers to turn on notices from wp-config.php. Relates #315…
156 }
9b09572d » saxmatt
2004-01-02 Turn down error reporting.
157
70a449d8 » saxmatt
2005-02-15 Allow for plugins to kick in before everything if define in wp-config
158 // For an advanced caching plugin to use, static because you would only want one
159 if ( defined('WP_CACHE') )
a45c3a3f » rob1n
2007-05-19 Don't fail when the user don't set WP-Cache up correctly. Props Denis…
160 @include ABSPATH . 'wp-content/advanced-cache.php';
70a449d8 » saxmatt
2005-02-15 Allow for plugins to kick in before everything if define in wp-config
161
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
162 /**
163 * Stores the location of the WordPress directory of functions, classes, and core content.
164 *
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
165 * @since 1.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
166 */
edc7d7cd » saxmatt
2003-12-31 Installation cleanup.
167 define('WPINC', 'wp-includes');
54d7ccba » markjaquith
2006-11-04 make /languages/ directory default to /wp-content/languages/ with fal…
168
169 if ( !defined('LANGDIR') ) {
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
170 /**
171 * Stores the location of the language directory. First looks for language folder in wp-content
172 * and uses that folder if it exists. Or it uses the "languages" folder in WPINC.
173 *
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
174 * @since 2.1.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
175 */
54d7ccba » markjaquith
2006-11-04 make /languages/ directory default to /wp-content/languages/ with fal…
176 if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') )
177 define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash
178 else
179 define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash
180 }
181
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
182 /**
183 * Allows for the plugins directory to be moved from the default location.
184 *
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
185 * This isn't used everywhere. Constant is not used in plugin_basename()
186 * which might cause conflicts with changing this.
187 *
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
188 * @since 2.1
189 */
7a032342 » ryan
2006-09-21 Turn hard-coded paths to defines. Pull gettext includes int wp-settin…
190 if ( !defined('PLUGINDIR') )
191 define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
b36471d4 » markjaquith
2007-09-13 Use wp_die() for WPDB bails. Send 500 response and no-cache headers s…
192
193 require (ABSPATH . WPINC . '/compat.php');
194 require (ABSPATH . WPINC . '/functions.php');
1d0bf72d » ryan
2007-10-31 AJAX for link category add and delete. Props mdawaffe. fixes #5291
195 require (ABSPATH . WPINC . '/classes.php');
b36471d4 » markjaquith
2007-09-13 Use wp_die() for WPDB bails. Send 500 response and no-cache headers s…
196
61f8b8f5 » westi
2007-10-06 Move database class loading to a shared function to ensure all of Wor…
197 require_wp_db();
e8dc8695 » ryan
2007-12-21 Custom DB error page. fixes #5500 for 2.4
198
199 if ( !empty($wpdb->error) )
200 dead_db();
201
1d0bf72d » ryan
2007-10-31 AJAX for link category add and delete. Props mdawaffe. fixes #5291
202 $prefix = $wpdb->set_prefix($table_prefix);
71a2674b » markjaquith
2006-12-15 Use $wpdb->prefix when defining table names
203
1d0bf72d » ryan
2007-10-31 AJAX for link category add and delete. Props mdawaffe. fixes #5291
204 if ( is_wp_error($prefix) )
42def106 » westi
2007-12-29 Use ' not " so we don't expand. Fixes #5546 props takayukister.
205 wp_die('<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.');
cde68f93 » markjaquith
2007-01-07 Exit gracefully with a warning if the table_prefix uses disallowed ch…
206
85723b89 » ryan
2005-11-07 Object caching, round one.
207 if ( file_exists(ABSPATH . 'wp-content/object-cache.php') )
b3d3d731 » rob1n
2007-04-25 Require once only. Props masquerade. fixes #4192
208 require_once (ABSPATH . 'wp-content/object-cache.php');
85723b89 » ryan
2005-11-07 Object caching, round one.
209 else
b3d3d731 » rob1n
2007-04-25 Require once only. Props masquerade. fixes #4192
210 require_once (ABSPATH . WPINC . '/cache.php');
85723b89 » ryan
2005-11-07 Object caching, round one.
211
212 wp_cache_init();
213
6d7717e1 » ryan
2006-06-20 Move plugin API to plugin.php. #2525
214 require (ABSPATH . WPINC . '/plugin.php');
81e7d921 » saxmatt
2005-02-07 Some filter action and cleanup
215 require (ABSPATH . WPINC . '/default-filters.php');
acc56027 » ryan
2007-01-18 Always load gettext.
216 include_once(ABSPATH . WPINC . '/streams.php');
217 include_once(ABSPATH . WPINC . '/gettext.php');
62927ab6 » ryan
2006-06-15 Remove wp- prefix from wp-l10n.php
218 require_once (ABSPATH . WPINC . '/l10n.php');
1bd4057b » saxmatt
2004-12-19 Bug fixes
219
3320dd13 » markjaquith
2007-03-07 Use strpos instead of strstr where ever possible, for speed. Props ro…
220 if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) {
25abcd13 » markjaquith
2007-08-03 More streamlined install process. Obeys WP_SITEURL if defined. fixes …
221 if ( defined('WP_SITEURL') )
321c3107 » ryan
2007-09-03 Remove trailing whitespace
222 $link = WP_SITEURL . '/wp-admin/install.php';
25abcd13 » markjaquith
2007-08-03 More streamlined install process. Obeys WP_SITEURL if defined. fixes …
223 elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)
224 $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php';
ca2815fb » saxmatt
2005-01-31 If we're already in wp-admin don't recursive link
225 else
25abcd13 » markjaquith
2007-08-03 More streamlined install process. Obeys WP_SITEURL if defined. fixes …
226 $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php';
227 require_once(ABSPATH . WPINC . '/kses.php');
228 require_once(ABSPATH . WPINC . '/pluggable.php');
229 wp_redirect($link);
230 die(); // have to die here ~ Mark
ca2815fb » saxmatt
2005-01-31 If we're already in wp-admin don't recursive link
231 }
1bd4057b » saxmatt
2004-12-19 Bug fixes
232
c93efa86 » ryan
2006-06-11 Include file renames. #2525
233 require (ABSPATH . WPINC . '/formatting.php');
a6ade4a7 » ryan
2005-07-11 Role/capability system. Round one. Props: Owen Winkler
234 require (ABSPATH . WPINC . '/capabilities.php');
9303053d » ryan
2006-03-13 Move WP_Query and its wrapper functions to query.php. #2525
235 require (ABSPATH . WPINC . '/query.php');
40b2e610 » ryan
2006-04-18 Move theme functions to theme.php. #2525
236 require (ABSPATH . WPINC . '/theme.php');
c56e62f5 » ryan
2006-06-08 Move user functions to user.php. Relocate more post functions to post…
237 require (ABSPATH . WPINC . '/user.php');
c93efa86 » ryan
2006-06-11 Include file renames. #2525
238 require (ABSPATH . WPINC . '/general-template.php');
239 require (ABSPATH . WPINC . '/link-template.php');
c56e62f5 » ryan
2006-06-08 Move user functions to user.php. Relocate more post functions to post…
240 require (ABSPATH . WPINC . '/author-template.php');
3c8ed766 » ryan
2006-06-07 Reworg post/page/attachment functions. #2525
241 require (ABSPATH . WPINC . '/post.php');
242 require (ABSPATH . WPINC . '/post-template.php');
0f5dc0f0 » ryan
2006-06-04 Reorg category functions. #2525
243 require (ABSPATH . WPINC . '/category.php');
244 require (ABSPATH . WPINC . '/category-template.php');
6027cfa9 » ryan
2006-04-19 Reorg comment functions. #2525
245 require (ABSPATH . WPINC . '/comment.php');
246 require (ABSPATH . WPINC . '/comment-template.php');
6970a75e » ryan
2006-03-12 Rewrite API additions and improvements from David House. #2433
247 require (ABSPATH . WPINC . '/rewrite.php');
c93efa86 » ryan
2006-06-11 Include file renames. #2525
248 require (ABSPATH . WPINC . '/feed.php');
19ea5fb7 » ryan
2006-06-05 Reorg bookmark functions. #2525
249 require (ABSPATH . WPINC . '/bookmark.php');
250 require (ABSPATH . WPINC . '/bookmark-template.php');
9dc65ab2 » saxmatt
2004-04-27 Cleaning up some includes.
251 require (ABSPATH . WPINC . '/kses.php');
fb1e5310 » ryan
2006-03-07 Cron improvements from masquerade. #2425
252 require (ABSPATH . WPINC . '/cron.php');
2520d8e8 » saxmatt
2005-02-07 Include cleanups
253 require (ABSPATH . WPINC . '/version.php');
ca92bb43 » ryan
2006-03-02 Move deprecated functions to deprecated.php. #2520
254 require (ABSPATH . WPINC . '/deprecated.php');
4d49e98f » ryan
2006-05-22 Script loader from mdawaffe. #2701
255 require (ABSPATH . WPINC . '/script-loader.php');
634a33c2 » ryan
2007-05-22 Very rough initial commit of taxonomy for everyone's hacking pleasure…
256 require (ABSPATH . WPINC . '/taxonomy.php');
7c2dbb9c » matt
2007-08-17 First pass at upgrade notification for core, see #1476. Also includes…
257 require (ABSPATH . WPINC . '/update.php');
6fc031de » markjaquith
2007-08-17 Canonical URLs, first swing. Props to Scott Yang, Ryan and Matt. see …
258 require (ABSPATH . WPINC . '/canonical.php');
da4a0d98 » saxmatt
2004-08-10 Fix for empty plugin strings, class include moved for timing.
259
3320dd13 » markjaquith
2007-03-07 Use strpos instead of strstr where ever possible, for speed. Props ro…
260 if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) {
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
261 // Used to guarantee unique hash cookies
262 $cookiehash = md5(get_option('siteurl'));
263 /**
264 * Used to guarantee unique hash cookies
265 * @since 1.5
266 */
321c3107 » ryan
2007-09-03 Remove trailing whitespace
267 define('COOKIEHASH', $cookiehash);
3320dd13 » markjaquith
2007-03-07 Use strpos instead of strstr where ever possible, for speed. Props ro…
268 }
5c97b54c » saxmatt
2003-12-15 Smilie fix from Jaykul, changed fool's siteurl fix to use faster preg…
269
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
270 /**
271 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
272 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
273 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
274 if ( !defined('USER_COOKIE') )
29ef8b6f » ryan
2007-12-16 New secure cookie protocol. see #5367
275 define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
276
277 /**
278 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
279 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
280 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
281 if ( !defined('PASS_COOKIE') )
29ef8b6f » ryan
2007-12-16 New secure cookie protocol. see #5367
282 define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
283
284 /**
285 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
286 * @since 2.5
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
287 */
29ef8b6f » ryan
2007-12-16 New secure cookie protocol. see #5367
288 if ( !defined('AUTH_COOKIE') )
289 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
290
291 /**
292 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
293 * @since 2.3.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
294 */
2662be20 » westi
2007-09-02 Inform the user when cookies are disabled and login fails. Fixed #203…
295 if ( !defined('TEST_COOKIE') )
296 define('TEST_COOKIE', 'wordpress_test_cookie');
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
297
298 /**
299 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
300 * @since 1.2.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
301 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
302 if ( !defined('COOKIEPATH') )
849a0d29 » ryan
2006-08-30 Use get_option instead of get_settings. Just 'cause.
303 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
304
305 /**
306 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
307 * @since 1.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
308 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
309 if ( !defined('SITECOOKIEPATH') )
849a0d29 » ryan
2006-08-30 Use get_option instead of get_settings. Just 'cause.
310 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
311
312 /**
313 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
314 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
315 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
316 if ( !defined('COOKIE_DOMAIN') )
317 define('COOKIE_DOMAIN', false);
318
9dc65ab2 » saxmatt
2004-04-27 Cleaning up some includes.
319 require (ABSPATH . WPINC . '/vars.php');
edc7d7cd » saxmatt
2003-12-31 Installation cleanup.
320
c26991b1 » saxmatt
2004-02-07 Move hack file include.
321 // Check for hacks file if the option is enabled
849a0d29 » ryan
2006-08-30 Use get_option instead of get_settings. Just 'cause.
322 if (get_option('hack_file')) {
764f50bd » markjaquith
2007-07-27 ABSPATH already has a trailing slash. Props Nazgul. fixes #4607
323 if (file_exists(ABSPATH . 'my-hacks.php'))
324 require(ABSPATH . 'my-hacks.php');
c26991b1 » saxmatt
2004-02-07 Move hack file include.
325 }
326
849a0d29 » ryan
2006-08-30 Use get_option instead of get_settings. Just 'cause.
327 if ( get_option('active_plugins') ) {
328 $current_plugins = get_option('active_plugins');
11f5bb3f » ryan
2005-03-31 Add a precautionary is_array() check around the plugin loading loop. h…
329 if ( is_array($current_plugins) ) {
330 foreach ($current_plugins as $plugin) {
83112722 » ryan
2007-03-06 Use PLUGINDIR. Props z720 and Nazgul. fixes #3909
331 if ('' != $plugin && file_exists(ABSPATH . PLUGINDIR . '/' . $plugin))
332 include_once(ABSPATH . PLUGINDIR . '/' . $plugin);
11f5bb3f » ryan
2005-03-31 Add a precautionary is_array() check around the plugin loading loop. h…
333 }
e733249e » saxmatt
2004-03-25 Functional plugin implementation.
334 }
335 }
1127059a » saxmatt
2004-04-19 shutdown action hook.
336
c93efa86 » ryan
2006-06-11 Include file renames. #2525
337 require (ABSPATH . WPINC . '/pluggable.php');
08b02d95 » ryan
2005-04-04 Move plugin replacebale functions to pluggable-functions.php. http://…
338
70a449d8 » saxmatt
2005-02-15 Allow for plugins to kick in before everything if define in wp-config
339 if ( defined('WP_CACHE') && function_exists('wp_cache_postload') )
340 wp_cache_postload();
341
342 do_action('plugins_loaded');
343
91efba11 » ryan
2005-07-05 Use wpdb->escape instead of addslashes to prepare DB bound data.
344 // If already slashed, strip.
345 if ( get_magic_quotes_gpc() ) {
6cbb6fec » ryan
2005-07-06 Stripslashes doesn't work on arrays. Add stripslashes_deep(). Props: …
346 $_GET = stripslashes_deep($_GET );
347 $_POST = stripslashes_deep($_POST );
348 $_COOKIE = stripslashes_deep($_COOKIE);
65bbec71 » saxmatt
2004-12-16 Comments refactoring and cleanup
349 }
350
91efba11 » ryan
2005-07-05 Use wpdb->escape instead of addslashes to prepare DB bound data.
351 // Escape with wpdb.
352 $_GET = add_magic_quotes($_GET );
353 $_POST = add_magic_quotes($_POST );
354 $_COOKIE = add_magic_quotes($_COOKIE);
355 $_SERVER = add_magic_quotes($_SERVER);
356
1034767a » ryan
2006-06-22 wp_get_current_commenter()
357 do_action('sanitize_comment_cookies');
358
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
359 /**
360 * WordPress Query object
361 * @global object $wp_the_query
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
362 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
363 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
364 $wp_the_query =& new WP_Query();
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
365
366 /**
367 * Holds the reference to @see $wp_the_query
368 * Use this global for WordPress queries
369 * @global object $wp_query
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
370 * @since 1.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
371 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
372 $wp_query =& $wp_the_query;
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
373
374 /**
375 * Holds the WordPress Rewrite object for creating pretty URLs
376 * @global object $wp_rewrite
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
377 * @since 1.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
378 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
379 $wp_rewrite =& new WP_Rewrite();
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
380
381 /**
382 * WordPress Object
383 * @global object $wp
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
384 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
385 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
386 $wp =& new WP();
1baf503d » ryan
2005-06-10 Break blog header up into functional chunks. Stick it all in a WP cla…
387
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
388
389 /**
390 * Web Path to the current active template directory
391 * @since 1.5
392 */
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
393 define('TEMPLATEPATH', get_template_directory());
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
394
395 /**
396 * Web Path to the current active template stylesheet directory
397 * @since 2.1
398 */
b55b6aa2 » ryan
2006-08-30 Allow stylesheet only themes to provide functions.php. Props skeltoac…
399 define('STYLESHEETPATH', get_stylesheet_directory());
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
400
401 // Load the default text localization domain.
402 load_default_textdomain();
403
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
404 /**
405 * The locale of the blog
406 * @since 1.5.0
407 */
3e264693 » ryan
2007-01-08 Load locale specific php code in global context. fixes #3488
408 $locale = get_locale();
409 $locale_file = ABSPATH . LANGDIR . "/$locale.php";
410 if ( is_readable($locale_file) )
411 require_once($locale_file);
412
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
413 // Pull in locale data after loading text domain.
414 require_once(ABSPATH . WPINC . '/locale.php');
415
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
416 /**
417 * WordPress Locale object for loading locale domain date and various strings.
418 * @global object $wp_locale
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
419 * @since 2.1.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
420 */
92421de7 » ryan
2006-11-19 Ref more singletons.
421 $wp_locale =& new WP_Locale();
3d2347a6 » ryan
2006-04-02 WP_Locale. Props Sewar. fixes #2568
422
c369310b » ryan
2005-08-29 Better support for theme plugins. add_theme_page() and active theme f…
423 // Load functions for active theme.
b55b6aa2 » ryan
2006-08-30 Allow stylesheet only themes to provide functions.php. Props skeltoac…
424 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') )
425 include(STYLESHEETPATH . '/functions.php');
426 if ( file_exists(TEMPLATEPATH . '/functions.php') )
427 include(TEMPLATEPATH . '/functions.php');
c369310b » ryan
2005-08-29 Better support for theme plugins. add_theme_page() and active theme f…
428
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
429 /**
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
430 * shutdown_action_hook() - Runs just before PHP shuts down execution.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
431 *
432 * @access private
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
433 * @since 1.2
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
434 */
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
435 function shutdown_action_hook() {
436 do_action('shutdown');
84da5fc9 » ryan
2006-01-06 Save cache after the shutdown hook runs. fixes #2232
437 wp_cache_close();
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
438 }
439 register_shutdown_function('shutdown_action_hook');
440
1baf503d » ryan
2005-06-10 Break blog header up into functional chunks. Stick it all in a WP cla…
441 // Everything is loaded and initialized.
98386088 » rboren
2005-02-01 Allow multiple args to be passed to apply_filters and do_action. Move…
442 do_action('init');
06a0fc3a » matt
2005-11-11 Formatting
443
629dde86 » rob1n
2007-05-25 Actually check for PHP 4.2. Props nbachiyski. fixes #4336
444 ?>
Something went wrong with that request. Please try again.