Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 146 lines (118 sloc) 4.927 kB
0bc8613 b2config.php replaced with wp-config.sample.php
mikelittle authored
1 <?php
43e4a8a The great renaming.
saxmatt authored
2 $HTTP_HOST = getenv('HTTP_HOST'); /* domain name */
3 $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
4 $HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
5
a18a23e Work around IIS' lack of REQUEST_URI
saxmatt authored
6 // Fix for IIS, which doesn't set REQUEST_URI
720316d Do not touch REQUEST_URI if it is already set by the server.
rboren authored
7 if (! isset($_SERVER['REQUEST_URI'])) {
8 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
9
10 // Append the query string if it exists and isn't null
11 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
12 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
13 }
12b4069 Fix REQUEST_URI construction for IIS. Bug 389. Patch from Dennis Wi…
rboren authored
14 }
a18a23e Work around IIS' lack of REQUEST_URI
saxmatt authored
15
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
16 if ( !(phpversion() >= '4.1') )
17 die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' );
18
0d040b3 Sanity check mysql.
saxmatt authored
19 if ( !extension_loaded('mysql') )
20 die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' );
21
551e52f Code cleanup and some fixes from the WP Japan folks.
saxmatt authored
22 function timer_start() {
23 global $timestart;
24 $mtime = explode(' ', microtime() );
25 $mtime = $mtime[1] + $mtime[0];
26 $timestart = $mtime;
27 return true;
28 }
29 timer_start();
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
30
9b09572 Turn down error reporting.
saxmatt authored
31 // Change to E_ALL for development/debugging
32 error_reporting(E_ALL ^ E_NOTICE);
33
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
34 // For an advanced caching plugin to use, static because you would only want one
35 if ( defined('WP_CACHE') )
36 require (ABSPATH . 'wp-content/advanced-cache.php');
37
edc7d7c Installation cleanup.
saxmatt authored
38 define('WPINC', 'wp-includes');
e9c7715 Using require_once will make it easier to incorporate WP functionalit…
emc3 authored
39 require_once (ABSPATH . WPINC . '/wp-db.php');
edc7d7c Installation cleanup.
saxmatt authored
40
25ae03e Giant commit, sorry mailing list people. Move all table names to new …
saxmatt authored
41 // Table names
2520d8e Include cleanups
saxmatt authored
42 $wpdb->posts = $table_prefix . 'posts';
43 $wpdb->users = $table_prefix . 'users';
44 $wpdb->categories = $table_prefix . 'categories';
45 $wpdb->post2cat = $table_prefix . 'post2cat';
46 $wpdb->comments = $table_prefix . 'comments';
47 $wpdb->links = $table_prefix . 'links';
48 $wpdb->linkcategories = $table_prefix . 'linkcategories';
49 $wpdb->options = $table_prefix . 'options';
50 $wpdb->postmeta = $table_prefix . 'postmeta';
25ae03e Giant commit, sorry mailing list people. Move all table names to new …
saxmatt authored
51
2765f58 Allow for custom user table. If rewriting user functions need to incl…
saxmatt authored
52 if ( defined('CUSTOM_USER_TABLE') )
53 $wpdb->users = CUSTOM_USER_TABLE;
54
8fff608 Sometimes we need to keep things around.
saxmatt authored
55 // We're going to need to keep this around for a few months even though we're not using it internally
56
57 $tableposts = $wpdb->posts;
58 $tableusers = $wpdb->users;
59 $tablecategories = $wpdb->categories;
60 $tablepost2cat = $wpdb->post2cat;
61 $tablecomments = $wpdb->comments;
62 $tablelinks = $wpdb->links;
63 $tablelinkcategories = $wpdb->linkcategories;
64 $tableoptions = $wpdb->options;
65 $tablepostmeta = $wpdb->postmeta;
66
9dc65ab Cleaning up some includes.
saxmatt authored
67 require (ABSPATH . WPINC . '/functions.php');
81e7d92 Some filter action and cleanup
saxmatt authored
68 require (ABSPATH . WPINC . '/default-filters.php');
ba04c52 Cleanup wp-l10n includes.
rboren authored
69 require_once (ABSPATH . WPINC . '/wp-l10n.php');
1bd4057 Bug fixes
saxmatt authored
70
71 $wpdb->hide_errors();
ca2815f If we're already in wp-admin don't recursive link
saxmatt authored
72 if ( !update_user_cache() && !strstr($_SERVER['PHP_SELF'], 'install.php') ) {
73 if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
74 $link = 'install.php';
75 else
76 $link = 'wp-admin/install.php';
77 die("It doesn't look like you've installed WP yet. Try running <a href='$link'>install.php</a>.");
78 }
1bd4057 Bug fixes
saxmatt authored
79 $wpdb->show_errors();
80
ba407ff E_ALL fixes and cleanups.
saxmatt authored
81 require (ABSPATH . WPINC . '/functions-formatting.php');
40a8e68 Trackback and pingback cleanups.
saxmatt authored
82 require (ABSPATH . WPINC . '/functions-post.php');
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
83 require (ABSPATH . WPINC . '/classes.php');
2520d8e Include cleanups
saxmatt authored
84 require (ABSPATH . WPINC . '/template-functions-general.php');
85 require (ABSPATH . WPINC . '/template-functions-links.php');
86 require (ABSPATH . WPINC . '/template-functions-author.php');
87 require (ABSPATH . WPINC . '/template-functions-post.php');
88 require (ABSPATH . WPINC . '/template-functions-category.php');
89 require (ABSPATH . WPINC . '/comment-functions.php');
90 require (ABSPATH . WPINC . '/feed-functions.php');
9dc65ab Cleaning up some includes.
saxmatt authored
91 require (ABSPATH . WPINC . '/links.php');
92 require (ABSPATH . WPINC . '/kses.php');
2520d8e Include cleanups
saxmatt authored
93 require (ABSPATH . WPINC . '/version.php');
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
94
a2342f1 Define COOKIEHASH and new get_profile function. TODO: re-org function…
saxmatt authored
95 if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import')) :
96 // Used to guarantee unique hash cookies
587429f Move to cookiehash define, use wp_login() function for auth.php.
saxmatt authored
97 $cookiehash = md5(get_settings('siteurl')); // Remove in 1.4
a2342f1 Define COOKIEHASH and new get_profile function. TODO: re-org function…
saxmatt authored
98 define('COOKIEHASH', $cookiehash);
99 endif;
5c97b54 Smilie fix from Jaykul, changed fool's siteurl fix to use faster preg…
saxmatt authored
100
9dc65ab Cleaning up some includes.
saxmatt authored
101 require (ABSPATH . WPINC . '/vars.php');
edc7d7c Installation cleanup.
saxmatt authored
102
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
103 do_action('core_files_loaded');
104
c26991b Move hack file include.
saxmatt authored
105 // Check for hacks file if the option is enabled
106 if (get_settings('hack_file')) {
107 if (file_exists(ABSPATH . '/my-hacks.php'))
108 require(ABSPATH . '/my-hacks.php');
109 }
110
ee4edd7 Load plugins even on plugin page.
saxmatt authored
111 if ( get_settings('active_plugins') ) {
a4aa259 Use array storage for plugins list.
saxmatt authored
112 $current_plugins = get_settings('active_plugins');
e733249 Functional plugin implementation.
saxmatt authored
113 foreach ($current_plugins as $plugin) {
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
114 if ('' != $plugin && file_exists(ABSPATH . 'wp-content/plugins/' . $plugin))
5a22f20 fix for #317: part two, avoid including the same plugin file twice
michelvaldrighi authored
115 include_once(ABSPATH . 'wp-content/plugins/' . $plugin);
e733249 Functional plugin implementation.
saxmatt authored
116 }
117 }
1127059 shutdown action hook.
saxmatt authored
118
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
119 if ( defined('WP_CACHE') && function_exists('wp_cache_postload') )
120 wp_cache_postload();
121
122 do_action('plugins_loaded');
123
b1f753a Define TEMPLATEPATH. Look for footer, sidebar, and header in the tem…
rboren authored
124 define('TEMPLATEPATH', get_template_directory());
125
0e73b09 Set the locale and load the default text domain after plugins are loa…
rboren authored
126 // Load the default text localization domain.
127 load_default_textdomain();
128
129 // Pull in locale data after loading text domain.
130 require_once(ABSPATH . WPINC . '/locale.php');
131
65bbec7 Comments refactoring and cleanup
saxmatt authored
132 if ( !get_magic_quotes_gpc() ) {
133 $_GET = add_magic_quotes($_GET );
134 $_POST = add_magic_quotes($_POST );
135 $_COOKIE = add_magic_quotes($_COOKIE);
136 $_SERVER = add_magic_quotes($_SERVER);
137 }
138
1127059 shutdown action hook.
saxmatt authored
139 function shutdown_action_hook() {
9838608 Allow multiple args to be passed to apply_filters and do_action. Mov…
rboren authored
140 do_action('shutdown');
1127059 shutdown action hook.
saxmatt authored
141 }
142 register_shutdown_function('shutdown_action_hook');
143
84f2d42 Add link filters for bug 743 (hat tip to morganiq). More abstraction…
rboren authored
144 // Everything is loaded.
9838608 Allow multiple args to be passed to apply_filters and do_action. Mov…
rboren authored
145 do_action('init');
1127059 shutdown action hook.
saxmatt authored
146 ?>
Something went wrong with that request. Please try again.