Changeset 12762 for trunk/wp-settings.php
- Timestamp:
- 01/19/2010 05:27:03 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-settings.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-settings.php
r12735 r12762 14 14 * @since 1.0.0 15 15 */ 16 define('WPINC', 'wp-includes'); 17 18 require (ABSPATH . WPINC . '/load.php'); 19 require (ABSPATH . WPINC . '/default-constants.php'); 20 require (ABSPATH . WPINC . '/version.php'); 21 22 wp_default_constants('init'); 23 24 set_magic_quotes_runtime(0); 25 @ini_set('magic_quotes_sybase', 0); 26 27 if ( function_exists('date_default_timezone_set') ) 28 date_default_timezone_set('UTC'); 29 16 define( 'WPINC', 'wp-includes' ); 17 18 // Include files required for initialization. 19 require( ABSPATH . WPINC . '/load.php' ); 20 require( ABSPATH . WPINC . '/default-constants.php' ); 21 require( ABSPATH . WPINC . '/version.php' ); 22 23 // Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. 24 wp_default_constants( 'init' ); 25 26 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. 27 set_magic_quotes_runtime( 0 ); 28 @ini_set( 'magic_quotes_sybase', 0 ); 29 30 // Set default timezone in PHP 5. 31 if ( function_exists( 'date_default_timezone_set' ) ) 32 date_default_timezone_set( 'UTC' ); 33 34 // Turn register_globals off. 30 35 wp_unregister_GLOBALS(); 31 36 37 // Ensure these global variables do not exist so they do not interfere with WordPress. 32 38 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); 33 39 40 // Standardize $_SERVER variables across setups. 34 41 wp_fix_server_vars(); 35 42 43 // Check for the required PHP version and for the MySQL extension or a database drop-in. 36 44 wp_check_php_mysql_versions(); 37 45 46 // Check if we're in maintenance mode. 38 47 wp_maintenance(); 39 48 49 // Start loading timer. 40 50 timer_start(); 41 51 52 // Check if we're in WP_DEBUG mode. 42 53 wp_debug_mode(); 43 54 44 // For an advanced caching plugin to use , static because you would only want one55 // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. 45 56 if ( WP_CACHE ) 46 57 @include WP_CONTENT_DIR . '/advanced-cache.php'; 47 58 59 // Define WP_LANG_DIR if not set. 48 60 wp_set_lang_dir(); 49 61 50 require (ABSPATH . WPINC . '/compat.php'); 51 require (ABSPATH . WPINC . '/functions.php'); 52 require (ABSPATH . WPINC . '/classes.php'); 53 62 // Include early WordPress files. 63 require( ABSPATH . WPINC . '/compat.php' ); 64 require( ABSPATH . WPINC . '/functions.php' ); 65 require( ABSPATH . WPINC . '/classes.php' ); 66 67 // Include the wpdb class, or a db.php database drop-in if present. 54 68 require_wp_db(); 55 69 70 // Set the database table prefix and the format specifiers for database table columns. 56 71 wp_set_wpdb_vars(); 57 72 73 // Start the WordPress object cache, or an external object cache if the drop-in is present. 58 74 wp_start_object_cache(); 59 75 76 // Initialize multisite if enabled. 60 77 if ( is_multisite() ) 61 require (ABSPATH . WPINC . '/ms-load.php'); 62 63 require (ABSPATH . WPINC . '/plugin.php'); 64 require (ABSPATH . WPINC . '/default-filters.php'); 65 include_once(ABSPATH . WPINC . '/pomo/mo.php'); 66 67 if ( SHORTINIT ) // stop most of WP being loaded, we just want the basics 78 require( ABSPATH . WPINC . '/ms-load.php' ); 79 80 // Load early WordPress files. 81 require( ABSPATH . WPINC . '/plugin.php' ); 82 require( ABSPATH . WPINC . '/default-filters.php' ); 83 include_once( ABSPATH . WPINC . '/pomo/mo.php' ); 84 85 // Stop most of WordPress from being loaded if we just want the basics. 86 if ( SHORTINIT ) 68 87 return false; 69 88 70 require_once (ABSPATH . WPINC . '/l10n.php'); 71 89 // Load the l18n library. 90 require_once ( ABSPATH . WPINC . '/l10n.php' ); 91 92 // Run the installer if WordPress is not installed. 72 93 wp_not_installed(); 73 94 74 require (ABSPATH . WPINC . '/formatting.php'); 75 require (ABSPATH . WPINC . '/capabilities.php'); 76 require (ABSPATH . WPINC . '/query.php'); 77 require (ABSPATH . WPINC . '/theme.php'); 78 require (ABSPATH . WPINC . '/user.php'); 79 require (ABSPATH . WPINC . '/meta.php'); 80 require (ABSPATH . WPINC . '/general-template.php'); 81 require (ABSPATH . WPINC . '/link-template.php'); 82 require (ABSPATH . WPINC . '/author-template.php'); 83 require (ABSPATH . WPINC . '/post.php'); 84 require (ABSPATH . WPINC . '/post-template.php'); 85 require (ABSPATH . WPINC . '/category.php'); 86 require (ABSPATH . WPINC . '/category-template.php'); 87 require (ABSPATH . WPINC . '/comment.php'); 88 require (ABSPATH . WPINC . '/comment-template.php'); 89 require (ABSPATH . WPINC . '/rewrite.php'); 90 require (ABSPATH . WPINC . '/feed.php'); 91 require (ABSPATH . WPINC . '/bookmark.php'); 92 require (ABSPATH . WPINC . '/bookmark-template.php'); 93 require (ABSPATH . WPINC . '/kses.php'); 94 require (ABSPATH . WPINC . '/cron.php'); 95 require (ABSPATH . WPINC . '/deprecated.php'); 96 require (ABSPATH . WPINC . '/script-loader.php'); 97 require (ABSPATH . WPINC . '/taxonomy.php'); 98 require (ABSPATH . WPINC . '/update.php'); 99 require (ABSPATH . WPINC . '/canonical.php'); 100 require (ABSPATH . WPINC . '/shortcodes.php'); 101 require (ABSPATH . WPINC . '/media.php'); 102 require (ABSPATH . WPINC . '/http.php'); 103 require (ABSPATH . WPINC . '/widgets.php'); 104 95 // Load most of WordPress. 96 require( ABSPATH . WPINC . '/formatting.php' ); 97 require( ABSPATH . WPINC . '/capabilities.php' ); 98 require( ABSPATH . WPINC . '/query.php' ); 99 require( ABSPATH . WPINC . '/theme.php' ); 100 require( ABSPATH . WPINC . '/user.php' ); 101 require( ABSPATH . WPINC . '/meta.php' ); 102 require( ABSPATH . WPINC . '/general-template.php' ); 103 require( ABSPATH . WPINC . '/link-template.php' ); 104 require( ABSPATH . WPINC . '/author-template.php' ); 105 require( ABSPATH . WPINC . '/post.php' ); 106 require( ABSPATH . WPINC . '/post-template.php' ); 107 require( ABSPATH . WPINC . '/category.php' ); 108 require( ABSPATH . WPINC . '/category-template.php' ); 109 require( ABSPATH . WPINC . '/comment.php' ); 110 require( ABSPATH . WPINC . '/comment-template.php' ); 111 require( ABSPATH . WPINC . '/rewrite.php' ); 112 require( ABSPATH . WPINC . '/feed.php' ); 113 require( ABSPATH . WPINC . '/bookmark.php' ); 114 require( ABSPATH . WPINC . '/bookmark-template.php' ); 115 require( ABSPATH . WPINC . '/kses.php' ); 116 require( ABSPATH . WPINC . '/cron.php' ); 117 require( ABSPATH . WPINC . '/deprecated.php' ); 118 require( ABSPATH . WPINC . '/script-loader.php' ); 119 require( ABSPATH . WPINC . '/taxonomy.php' ); 120 require( ABSPATH . WPINC . '/update.php' ); 121 require( ABSPATH . WPINC . '/canonical.php' ); 122 require( ABSPATH . WPINC . '/shortcodes.php' ); 123 require( ABSPATH . WPINC . '/media.php' ); 124 require( ABSPATH . WPINC . '/http.php' ); 125 require( ABSPATH . WPINC . '/widgets.php' ); 126 127 // Load multisite-specific files. 105 128 if ( is_multisite() ) { 106 129 require_once( ABSPATH . WPINC . '/ms-functions.php' ); … … 109 132 } 110 133 111 wp_default_constants('wp_included'); 112 134 // Define constants that rely on the API to obtain the default value. 135 wp_default_constants( 'wp_included' ); 136 137 // Set up multisite if enabled. 113 138 if ( is_multisite() ) 114 ms_network_settings(); 115 116 wp_default_constants('ms_network_settings_loaded'); 117 118 wp_load_mu_plugins(); 119 120 /** 121 * Used to load network wide plugins 122 * @since 3.0 123 */ 124 if ( is_multisite() ) 125 ms_network_plugins(); 126 127 do_action('muplugins_loaded'); 128 129 /** 130 * Used to check site status 131 * @since 3.0 132 */ 139 ms_network_settings(); 140 141 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. 142 wp_default_constants( 'ms_network_settings_loaded' ); 143 144 // Load must-use plugins. 145 foreach( wp_muplugins_to_load() as $mu_plugin ) 146 include_once( $mu_plugin ); 147 unset( $mu_plugin ); 148 149 // Load network-wide plugins if multisite. 133 150 if ( is_multisite() ) { 134 ms_site_check(); 151 foreach ( ms_network_plugins() as $plugin_file ) 152 include_once( $plugin_file ); 153 unset( $plugin_file ); 154 } 155 156 do_action( 'muplugins_loaded' ); 157 158 // Check site status if multisite. 159 if ( is_multisite() ) { 160 if ( true !== ( $file = ms_site_check() ) ) { 161 require_once( $file ); 162 die(); 163 } 135 164 ms_network_cookies(); 136 165 } 137 166 138 wp_default_constants('ms_loaded'); 139 140 require (ABSPATH . WPINC . '/vars.php'); 141 142 // make taxonomies available to plugins and themes 143 // @plugin authors: warning: this gets registered again on the init hook 167 // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). 168 wp_default_constants( 'ms_loaded' ); 169 170 // Create common globals. 171 require( ABSPATH . WPINC . '/vars.php' ); 172 173 // Make taxonomies available to plugins and themes. 174 // @plugin authors: warning: this gets registered again on the init hook. 144 175 create_initial_taxonomies(); 145 176 146 wp_load_plugins(); 147 148 require (ABSPATH . WPINC . '/pluggable.php'); 149 177 // Load active plugins. 178 foreach( wp_plugins_to_load() as $plugin ) 179 include_once( $plugin ); 180 unset( $plugin ); 181 182 // Load pluggable functions. 183 require( ABSPATH . WPINC . '/pluggable.php' ); 184 185 // Set internal encoding. 150 186 wp_set_internal_encoding(); 151 187 152 if ( WP_CACHE && function_exists('wp_cache_postload') ) 188 // Run wp_cache_postload() if object cache is enabled and the function exists. 189 if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) 153 190 wp_cache_postload(); 154 191 155 do_action('plugins_loaded'); 156 157 wp_default_constants('plugins_loaded'); 158 192 do_action( 'plugins_loaded' ); 193 194 // Define WP_POST_REVISIONS if not already defined. 195 wp_default_constants( 'plugins_loaded' ); 196 197 // Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) 159 198 wp_magic_quotes(); 160 199 161 do_action( 'sanitize_comment_cookies');200 do_action( 'sanitize_comment_cookies' ); 162 201 163 202 /** … … 174 213 * @since 1.5.0 175 214 */ 176 $wp_query =& $wp_the_query;215 $wp_query =& $wp_the_query; 177 216 178 217 /** … … 181 220 * @since 1.5.0 182 221 */ 183 $wp_rewrite =& new WP_Rewrite();222 $wp_rewrite =& new WP_Rewrite(); 184 223 185 224 /** … … 188 227 * @since 2.0.0 189 228 */ 190 $wp =& new WP();229 $wp =& new WP(); 191 230 192 231 /** … … 197 236 $wp_widget_factory =& new WP_Widget_Factory(); 198 237 199 do_action('setup_theme'); 200 201 wp_default_constants('setup_theme'); 238 do_action( 'setup_theme' ); 239 240 // Define the TEMPLATEPATH and STYLESHEETPATH constants. 241 wp_default_constants( 'setup_theme' ); 202 242 203 243 // Load the default text localization domain. 204 244 load_default_textdomain(); 205 245 206 wp_find_locale(); 246 // Find the blog locale. 247 $locale = get_locale(); 248 $locale_file = WP_LANG_DIR . "/$locale.php"; 249 if ( is_readable( $locale_file ) ) 250 require_once( $locale_file ); 251 252 // Pull in locale data after loading text domain. 253 require_once( ABSPATH . WPINC . '/locale.php' ); 207 254 208 255 /** … … 213 260 $wp_locale =& new WP_Locale(); 214 261 215 wp_load_theme_functions(); 216 217 register_shutdown_function('shutdown_action_hook'); 218 219 $wp->init(); // Sets up current user. 262 // Load the functions for the active theme, for both parent and child theme if applicable. 263 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) 264 include( STYLESHEETPATH . '/functions.php' ); 265 if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) 266 include( TEMPLATEPATH . '/functions.php' ); 267 268 // Load any template functions the theme supports. 269 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' ); 270 271 register_shutdown_function( 'shutdown_action_hook' ); 272 273 // Set up current user. 274 $wp->init(); 220 275 221 276 // Everything is loaded and initialized. 222 do_action( 'init');277 do_action( 'init' ); 223 278 224 279 ?>
Note: See TracChangeset
for help on using the changeset viewer.