Index: wp-admin/load-scripts.php
===================================================================
--- wp-admin/load-scripts.php	(revision 12978)
+++ wp-admin/load-scripts.php	(working copy)
@@ -99,8 +99,9 @@
 if ( empty($load) )
 	exit;
 
-require(ABSPATH . WPINC . '/script-loader.php');
-require(ABSPATH . WPINC . '/version.php');
+require( ABSPATH . WPINC . '/default-constants.php' );
+require( ABSPATH . WPINC . '/script-loader.php' );
+require( ABSPATH . WPINC . '/version.php' );
 
 $compress = ( isset($_GET['c']) && $_GET['c'] );
 $force_gzip = ( $compress && 'gzip' == $_GET['c'] );
Index: wp-admin/load-styles.php
===================================================================
--- wp-admin/load-styles.php	(revision 12978)
+++ wp-admin/load-styles.php	(working copy)
@@ -93,8 +93,9 @@
 	return @file_get_contents($path);
 }
 
-require(ABSPATH . '/wp-includes/script-loader.php');
-require(ABSPATH . '/wp-includes/version.php');
+require( ABSPATH . WPINC . '/default-constants.php' );
+require( ABSPATH . WPINC . '/script-loader.php' );
+require( ABSPATH . WPINC . '/version.php');
 
 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
 $load = explode(',', $load);
Index: wp-includes/default-constants.php
===================================================================
--- wp-includes/default-constants.php	(revision 12962)
+++ wp-includes/default-constants.php	(working copy)
@@ -9,259 +9,268 @@
  * Defines WordPress default constants.
  *
  * @since 3.0.0
- * @param $context
+ * @param $constants Constants to define.
  */
-function wp_default_constants( $context ) {
+function wp_default_constants( $constants ) {
+	if ( ! is_array( $constants ) )
+		$constants = func_get_args();
 
-	switch( $context ) {
+	foreach ( $constants as $constant ) :
+		if ( defined( $constant ) ) {
+			continue;
+		} elseif ( '$' == substr( $constant, 0, 1 ) ) { // the rare variable
+			$var = substr( $constant, 1 );
+			if ( isset( $$var ) )
+				continue;
+			global $$var;
+		}
 
-		case 'init' :
-
-			// set memory limits
-			if ( !defined('WP_MEMORY_LIMIT') ) {
-				if( is_multisite() ) {
-					define('WP_MEMORY_LIMIT', '64M');
-				} else {
-					define('WP_MEMORY_LIMIT', '32M');
-				}
-			}
-
-			/**
-			 * 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.0
-			 */
-			if ( ! isset($blog_id) )
+		switch( $constant ) :
+			case 'WP_MEMORY_LIMIT' :
+				if ( is_multisite() )
+					define( 'WP_MEMORY_LIMIT', '64M' );
+				else
+					define( 'WP_MEMORY_LIMIT', '32M' );
+				break;
+			case '$blog_id' :
+				/**
+				 * 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.0
+				 */
 				$blog_id = 1;
-
-			// set memory limits.
-			if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) )
-				@ini_set('memory_limit', WP_MEMORY_LIMIT);
-
-			if ( !defined('WP_CONTENT_DIR') )
+				break;
+			case 'WP_CONTENT_DIR' :
 				define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
-
-			// Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development.
-			if ( !defined('WP_DEBUG') )
+				break;
+			case 'WP_DEBUG' :
+				/**
+				 * Add define( 'WP_DEBUG', true ); to wp-config.php to enable display of notices during development.
+				 */
 				define( 'WP_DEBUG', false );
-
-			// Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On
-			if ( !defined('WP_DEBUG_DISPLAY') )
+				break;
+			case 'WP_DEBUG_DISPLAY' :
+				/**
+				 * Add define( 'WP_DEBUG_DISPLAY', false ); to wp-config.php to use the globally configured setting for display_errors and not force it to On.
+				 * @since 2.9.0
+				 */
 				define( 'WP_DEBUG_DISPLAY', true );
-
-			// Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log
-			if ( !defined('WP_DEBUG_LOG') )
-				define('WP_DEBUG_LOG', false);
-
-			if ( !defined('WP_CACHE') )
-				define('WP_CACHE', false);
-
-			/**
-			 * Private
-			 */
-			if ( !defined('MEDIA_TRASH') )
-				define('MEDIA_TRASH', false);
-
-			if ( !defined('SHORTINIT') )
-				define('SHORTINIT', false);
-			break;
-
-		case 'wp_included':
-
-			if ( !defined('WP_CONTENT_URL') )
-				define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
-
-			/**
-			 * Allows for the plugins directory to be moved from the default location.
-			 *
-			 * @since 2.6.0
-			 */
-			if ( !defined('WP_PLUGIN_DIR') )
+				break;
+			case 'WP_DEBUG_LOG' :
+				/**
+				 * Add define( 'WP_DEBUG_LOG', true ); to wp-config.php to enable PHP debug logging to wp-content/debug.log.
+				 * @since 2.9.0
+				 */
+				define( 'WP_DEBUG_LOG', false );
+				break;
+			case 'WP_CACHE' :
+				/**
+				 * External object cache support.
+				 */
+				define( 'WP_CACHE', false );
+				break;
+			case 'MEDIA_TRASH' :
+				define( 'MEDIA_TRASH', false );
+				break;
+			case 'SHORTINIT' :
+				define( 'SHORTINIT', false );
+				break;
+			case 'WP_CONTENT_URL' :
+				if ( defined( 'WP_CONTENT_DIR' ) )
+					define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // full url - WP_CONTENT_DIR is defined further up
+				else
+					define( 'WP_CONTENT_URL', '' ); // for script-loader.php
+				break;
+			case 'WP_PLUGIN_DIR' :
+				/**
+				 * Allows for the plugins directory to be moved from the default location.
+				 * @since 2.6.0
+				 */
 				define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
-
-			/**
-			 * Allows for the plugins directory to be moved from the default location.
-			 *
-			 * @since 2.6.0
-			 */
-			if ( !defined('WP_PLUGIN_URL') )
+				break;
+			case 'WP_PLUGIN_URL' :
+				/**
+				 * Allows for the plugins directory to be moved from the default location.
+				 * @since 2.6.0
+				 */
 				define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash
-
-			/**
-			 * Allows for the plugins directory to be moved from the default location.
-			 *
-			 * @since 2.1.0
-			 * @deprecated
-			 */
-			if ( !defined('PLUGINDIR') )
+				break;
+			case 'PLUGINDIR' :
+				/**
+				 * Allows for the plugins directory to be moved from the default location.
+				 * @since 2.1.0
+				 * @deprecated
+				 */
 				define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH.  For back compat.
-
-			/**
-			 * Allows for the mu-plugins directory to be moved from the default location.
-			 *
-			 * @since 2.8.0
-			 */
-			if ( !defined('WPMU_PLUGIN_DIR') )
+				break;
+			case 'WPMU_PLUGIN_DIR' :
+				/**
+				 * Allows for the mu-plugins directory to be moved from the default location.
+				 * @since 2.8.0
+				 */
 				define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash
-
-			/**
-			 * Allows for the mu-plugins directory to be moved from the default location.
-			 *
-			 * @since 2.8.0
-			 */
-			if ( !defined('WPMU_PLUGIN_URL') )
+				break;
+			case 'WPMU_PLUGIN_URL' :
+				/**
+				 * Allows for the mu-plugins directory to be moved from the default location.
+				 * @since 2.8.0
+				 */
 				define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash
-
-			/**
-			 * Allows for the mu-plugins directory to be moved from the default location.
-			 *
-			 * @since 2.8.0
-			 * @deprecated
-			 */
-			if ( !defined( 'MUPLUGINDIR' ) )
+				break;
+			case 'MUPLUGINDIR' :
+				/**
+				 * Allows for the mu-plugins directory to be moved from the default location.
+				 * @since 2.8.0
+				 * @deprecated
+				 */
 				define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH.  For back compat.
-			break;
-
-		case 'ms_loaded';
-
-			global $wp_default_secret_key;
-
-			/**
-			 * Used to guarantee unique hash cookies
-			 * @since 1.5
-			 */
-			if ( !defined( 'COOKIEHASH' ) ) {
-				$siteurl = get_site_option( 'siteurl' );
-				if ( $siteurl )
+				break;
+			case '$wp_default_secret_key' :
+				/**
+				 * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
+				 * @since 2.5.0
+				 */
+				$wp_default_secret_key = 'put your unique phrase here';
+				break;
+			case 'COOKIEHASH' :
+				/**
+				 * Used to guarantee unique hash cookies
+				 * @since 1.5
+				 */
+				if ( $siteurl = get_site_option( 'siteurl' ) )
 					define( 'COOKIEHASH', md5( $siteurl ) );
 				else
 					define( 'COOKIEHASH', '' );
-			}
-
-			/**
-			 * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
-			 * @since 2.5.0
-			 */
-			$wp_default_secret_key = 'put your unique phrase here';
-
-			/**
-			 * @since 2.0.0
-			 */
-			if ( !defined('USER_COOKIE') )
-				define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
-
-			/**
-			 * @since 2.0.0
-			 */
-			if ( !defined('PASS_COOKIE') )
-				define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
-
-			/**
-			 * @since 2.5.0
-			 */
-			if ( !defined('AUTH_COOKIE') )
-				define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
-
-			/**
-			 * @since 2.6.0
-			 */
-			if ( !defined('SECURE_AUTH_COOKIE') )
-				define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH);
-
-			/**
-			 * @since 2.6.0
-			 */
-			if ( !defined('LOGGED_IN_COOKIE') )
-				define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);
-
-			/**
-			 * @since 2.3.0
-			 */
-			if ( !defined('TEST_COOKIE') )
-				define('TEST_COOKIE', 'wordpress_test_cookie');
-
-			/**
-			 * @since 1.2.0
-			 */
-			if ( !defined('COOKIEPATH') )
-				define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
-
-			/**
-			 * @since 1.5.0
-			 */
-			if ( !defined('SITECOOKIEPATH') )
-				define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
-
-			/**
-			 * @since 2.6.0
-			 */
-			if ( !defined('ADMIN_COOKIE_PATH') )
+				break;
+			case 'USER_COOKIE' :
+				/**
+				 * @since 2.0.0
+				 */
+				define( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH );
+				break;
+			case 'PASS_COOKIE' :
+				/**
+				 * @since 2.0.0
+				 */
+				define( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH );
+				break;
+			case 'AUTH_COOKIE' :
+				/**
+				 * @since 2.5.0
+				 */
+				define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );
+				break;
+			case 'SECURE_AUTH_COOKIE' :
+				/**
+				 * @since 2.6.0
+				 */
+				define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );
+				break;
+			case 'LOGGED_IN_COOKIE' :
+				/**
+				 * @since 2.6.0
+				 */
+				define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
+				break;
+			case 'TEST_COOKIE' :
+				/**
+				 * @since 2.3.0
+				 */
+				define( 'TEST_COOKIE', 'wordpress_test_cookie' );
+				break;
+			case 'COOKIEPATH' :
+				/**
+				 * @since 1.2.0
+				 */
+				define( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'home' ) . '/' ) );
+				break;
+			case 'SITECOOKIEPATH' :
+				/**
+				 * @since 1.5.0
+				 */
+				define( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'siteurl' ) . '/' ) );
+				break;
+			case 'ADMIN_COOKIE_PATH' :
+				/**
+				 * @since 2.6.0
+				 */
 				define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
-
-			/**
-			 * @since 2.6.0
-			 */
-			if ( !defined('PLUGINS_COOKIE_PATH') )
-				define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL)  );
-
-			/**
-			 * @since 2.0.0
-			 */
-			if ( !defined('COOKIE_DOMAIN') )
-				define('COOKIE_DOMAIN', false);
-
-			/**
-			 * @since 2.6.0
-			 */
-			if ( !defined('FORCE_SSL_ADMIN') )
-				define('FORCE_SSL_ADMIN', false);
-			force_ssl_admin(FORCE_SSL_ADMIN);
-
-			/**
-			 * @since 2.6.0
-			 */
-			if ( !defined('FORCE_SSL_LOGIN') )
-				define('FORCE_SSL_LOGIN', false);
-			force_ssl_login(FORCE_SSL_LOGIN);
-
-			/**
-			 * @since 2.5.0
-			 */
-			if ( !defined( 'AUTOSAVE_INTERVAL' ) )
+				break;
+			case 'PLUGINS_COOKIE_PATH' :
+				/**
+				 * @since 2.6.0
+				 */
+				define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL )  );
+				break;
+			case 'COOKIE_DOMAIN' :
+				/**
+				 * @since 2.0.0
+				 */
+				define( 'COOKIE_DOMAIN', false );
+				break;
+			case 'FORCE_SSL_ADMIN' :
+				/**
+				 * @since 2.6.0
+				 */
+				define( 'FORCE_SSL_ADMIN', false );
+				break;
+			case 'FORCE_SSL_LOGIN' :
+				/**
+				 * @since 2.6.0
+				 */
+				define( 'FORCE_SSL_LOGIN', false );
+				break;
+			case 'AUTOSAVE_INTERVAL' :
+				/**
+				 * @since 2.5.0
+				 */
 				define( 'AUTOSAVE_INTERVAL', 60 );
-
-			/**
-			 * @since 2.9.0
-			 */
-			if ( !defined( 'EMPTY_TRASH_DAYS' ) )
+				break;
+			case 'EMPTY_TRASH_DAYS' :
+				/**
+				 * @since 2.9.0
+				 */
 				define( 'EMPTY_TRASH_DAYS', 30 );
-			break;
-
-		case 'plugins_loaded':
-
-			if ( !defined('WP_POST_REVISIONS') )
-			define('WP_POST_REVISIONS', true);
-			break;
-
-		case 'setup_theme':
-
-			/**
-			 * Web Path to the current active template directory
-			 * @since 1.5.0
-			 */
-			define('TEMPLATEPATH', get_template_directory());
-
-			/**
-			 * Web Path to the current active template stylesheet directory
-			 * @since 2.1.0
-			 */
-			define('STYLESHEETPATH', get_stylesheet_directory());
-			break;
-
-	}
-
+				break;
+			case 'WP_POST_REVISIONS' :
+				define( 'WP_POST_REVISIONS', true );
+				break;
+			case 'TEMPLATEPATH' :
+				/**
+				 * Web Path to the current active template directory
+				 * @since 1.5.0
+				 */
+				define( 'TEMPLATEPATH', get_template_directory() );
+				break;
+			case 'STYLESHEETPATH' :
+				/**
+				 * Web Path to the current active template stylesheet directory
+				 * @since 2.1.0
+				 */
+				define( 'STYLESHEETPATH', get_stylesheet_directory() );
+				break;
+			case 'SCRIPT_DEBUG' :
+				define( 'SCRIPT_DEBUG', false );
+				break;
+			case 'STYLE_DEBUG' :
+				define( 'STYLE_DEBUG', false );
+				break;
+			case 'CONCATENATE_SCRIPTS' :
+				define( 'CONCATENATE_SCRIPTS', true );
+				break;
+			case 'COMPRESS_SCRIPTS' :
+				define( 'COMPRESS_SCRIPTS', true );
+				break;
+			case 'COMPRESS_CSS' :
+				define( 'COMPRESS_CSS', true );
+				break;
+			case 'ENFORCE_GZIP' :
+				define( 'ENFORCE_GZIP', false );
+				break;
+		endswitch;
+	endforeach;
 }
 
 ?>
Index: wp-includes/ms-default-constants.php
===================================================================
--- wp-includes/ms-default-constants.php	(revision 12962)
+++ wp-includes/ms-default-constants.php	(working copy)
@@ -10,64 +10,64 @@
  * Defines Multisite default constants.
  *
  * @since 3.0.0
- * @param $context
+ * @param $constants Constants to define
  */
-function ms_default_constants( $context ) {
-	switch( $context ) {
-		case 'uploads' :
-			global $wpdb;
-			/** @since 3.0.0 */
-			if ( !defined( 'UPLOADBLOGSDIR' ) )
+function ms_default_constants( $constants ) {
+	global $wpdb, $current_site;
+	if ( ! is_array( $constants ) )
+		$constants = func_get_args();
+
+	foreach ( $constants as $constant ) :
+		if ( defined( $constant ) )
+			continue;
+
+		switch( $constant ) :
+			case 'UPLOADBLOGSDIR' :
+				/** @since 3.0.0 */
 				define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
-			/** @since 3.0.0 */
-			if ( !defined( 'UPLOADS' ) )
+				break;
+			case 'UPLOADS' :
+				/** @since 3.0.0 */
 				define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
-			/** @since 3.0.0 */
-			if ( !defined( 'BLOGUPLOADDIR' ) )
+				break;
+			case 'BLOGUPLOADDIR' :
+				/** @since 3.0.0 */
 				define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
-			break;
-		case 'cookies' :
-			global $current_site;
-			/**
-			 * @since 1.2.0
-			 */
-			if ( !defined( 'COOKIEPATH' ) )
-					define( 'COOKIEPATH', $current_site->path );
-			/**
-			 * @since 1.5.0
-			 */
-			if ( !defined( 'SITECOOKIEPATH' ) )
-					define( 'SITECOOKIEPATH', $current_site->path );
-			/**
-			 * @since 2.6.0
-			 */
-			if ( !defined( 'ADMIN_COOKIE_PATH' ) ) {
-					if( !is_subdomain_install() ) {
-							define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
-					} else {
-							define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
-					}
-			}
-			/**
-			 * @since 2.0.0
-			 */
-			if ( !defined('COOKIE_DOMAIN') )
-					define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
-			break;
-		case 'ms-files' :
-			/**
-			 * Optional support for X-Sendfile header
-			 * @since 3.0.0
-			 */
-			if ( !defined( 'WPMU_SENDFILE' ) )
+				break;
+			case 'COOKIEPATH' :
+				/** @since 1.2.0 */
+				define( 'COOKIEPATH', $current_site->path );
+				break;
+			case 'SITECOOKIEPATH' :
+				/** @since 1.5.0 */
+				define( 'SITECOOKIEPATH', $current_site->path );
+				break;
+			case 'ADMIN_COOKIE_PATH' :
+				/** @since 2.6.0 */
+				if( ! is_subdomain_install() )
+					define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
+				else
+					define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
+				break;
+			case 'COOKIE_DOMAIN' :
+				/** @since 2.0.0 */
+				define( 'COOKIE_DOMAIN', '.' . $current_site->cookie_domain );
+				break;
+			case 'WPMU_SENDFILE' :
+				/**
+				 * Optional support for X-Sendfile header
+				 * @since 3.0.0
+				 */
 				define( 'WPMU_SENDFILE', false );
-			/**
-			 * Optional support for X-Accel-Redirect header
-			 * @since 3.0.0
-			 */
-			if ( !defined( 'WPMU_ACCEL_REDIRECT' ) )
+				break;
+			case 'WPMU_ACCEL_REDIRECT' :
+				/**
+				 * Optional support for X-Accel-Redirect header
+				 * @since 3.0.0
+				 */
 				define( 'WPMU_ACCEL_REDIRECT', false );
-			break;
-	}
+				break;
+		endswitch;
+	endforeach;
 }
 ?>
\ No newline at end of file
Index: wp-includes/ms-files.php
===================================================================
--- wp-includes/ms-files.php	(revision 12962)
+++ wp-includes/ms-files.php	(working copy)
@@ -10,7 +10,7 @@
 
 define( 'SHORTINIT', true );
 require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
-ms_default_constants( 'ms-files' );
+ms_default_constants( 'WPMU_SENDFILE', 'WPMU_ACCEL_REDIRECT' );
 
 error_reporting(0);
 
Index: wp-includes/ms-settings.php
===================================================================
--- wp-includes/ms-settings.php	(revision 12962)
+++ wp-includes/ms-settings.php	(working copy)
@@ -124,6 +124,6 @@
 wp_start_object_cache();
 
 // Define upload directory constants
-ms_default_constants( 'uploads' );
+ms_default_constants( 'UPLOADBLOGSDIR', 'UPLOADS', 'BLOGUPLOADDIR' );
 
 ?>
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 12962)
+++ wp-includes/script-loader.php	(working copy)
@@ -37,6 +37,9 @@
 /** BackPress: WordPress Styles Functions */
 require( ABSPATH . WPINC . '/functions.wp-styles.php' );
 
+/** Define default constants. */
+wp_default_constants( 'WP_CONTENT_URL', 'SCRIPT_DEBUG', 'STYLE_DEBUG', 'CONCATENATE_SCRIPTS', 'COMPRESS_SCRIPTS', 'COMPRESS_CSS', 'ENFORCE_GZIP' );
+
 /**
  * Setup WordPress scripts to load by default for Administration Panels.
  *
@@ -53,11 +56,11 @@
 		$guessurl = wp_guess_url();
 
 	$scripts->base_url = $guessurl;
-	$scripts->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
+	$scripts->content_url = WP_CONTENT_URL;
 	$scripts->default_version = get_bloginfo( 'version' );
 	$scripts->default_dirs = array('/wp-admin/js/', '/wp-includes/js/');
 
-	$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
+	$suffix = SCRIPT_DEBUG ? '.dev' : '';
 
 	$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
 
@@ -187,7 +190,7 @@
 	$scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2201');
 	$scripts->add( 'swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array('swfupload'), '2201');
 
-	if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) {
+	if ( SCRIPT_DEBUG ) {
 		// queue all SWFUpload scripts that are used by default
 		$scripts->add( 'swfupload-all', false, array('swfupload', 'swfupload-swfobject', 'swfupload-queue'), '2201');
 	} else {
@@ -419,12 +422,12 @@
 		$guessurl = wp_guess_url();
 
 	$styles->base_url = $guessurl;
-	$styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
+	$styles->content_url = WP_CONTENT_URL;
 	$styles->default_version = get_bloginfo( 'version' );
 	$styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr';
 	$styles->default_dirs = array('/wp-admin/');
 
-	$suffix = defined('STYLE_DEBUG') && STYLE_DEBUG ? '.dev' : '';
+	$suffix = STYLE_DEBUG ? '.dev' : '';
 
 	$rtl_styles = array( 'wp-admin', 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' );
 
@@ -544,7 +547,7 @@
 		$parsed = parse_url( $src );
 		$url = $color->url;
 
-		if ( defined('STYLE_DEBUG') && STYLE_DEBUG )
+		if ( STYLE_DEBUG )
 			$url = preg_replace('/.css$|.css(?=\?)/', '.dev.css', $url);
 
 		if ( isset($parsed['query']) && $parsed['query'] ) {
@@ -616,7 +619,7 @@
 	global $wp_scripts, $compress_scripts;
 
 	$zip = $compress_scripts ? 1 : 0;
-	if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
+	if ( $zip && ENFORCE_GZIP )
 		$zip = 'gzip';
 
 	if ( !empty($wp_scripts->concat) ) {
@@ -688,7 +691,7 @@
 	script_concat_settings();
 	$wp_styles->do_concat = $concatenate_scripts;
 	$zip = $compress_css ? 1 : 0;
-	if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
+	if ( $zip && ENFORCE_GZIP )
 		$zip = 'gzip';
 
 	$wp_styles->do_items(false);
@@ -716,19 +719,19 @@
 	$compressed_output = ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') );
 
 	if ( ! isset($concatenate_scripts) ) {
-		$concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
-		if ( ! is_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
+		$concatenate_scripts = CONCATENATE_SCRIPTS;
+		if ( ! is_admin() || ( SCRIPT_DEBUG ) )
 			$concatenate_scripts = false;
 	}
 
 	if ( ! isset($compress_scripts) ) {
-		$compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
+		$compress_scripts = COMPRESS_SCRIPTS;
 		if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
 			$compress_scripts = false;
 	}
 
 	if ( ! isset($compress_css) ) {
-		$compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;
+		$compress_css = COMPRESS_CSS;
 		if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
 			$compress_css = false;
 	}
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 12962)
+++ wp-settings.php	(working copy)
@@ -20,9 +20,14 @@
 require( ABSPATH . WPINC . '/default-constants.php' );
 require( ABSPATH . WPINC . '/version.php' );
 
-// Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
-wp_default_constants( 'init' );
+// Set initial default constants and $blog_id.
+wp_default_constants( 'WP_MEMORY_LIMIT', '$blog_id', 'WP_CONTENT_DIR', 'WP_DEBUG', 'WP_DEBUG_DISPLAY',
+	'WP_DEBUG_LOG', 'WP_CACHE', 'MEDIA_TRASH', 'SHORTINIT' );
 
+// set memory limits.
+if ( function_exists( 'memory_get_usage' ) && ( (int) @ini_get('memory_limit') < abs( intval(WP_MEMORY_LIMIT ) ) ) )
+	@ini_set( 'memory_limit', WP_MEMORY_LIMIT );
+
 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
 set_magic_quotes_runtime( 0 );
 @ini_set( 'magic_quotes_sybase', 0 );
@@ -133,7 +138,7 @@
 
 // Define constants that rely on the API to obtain the default value.
 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
-wp_default_constants( 'wp_included' );
+wp_default_constants( 'WP_CONTENT_URL', 'WP_PLUGIN_DIR', 'WP_PLUGIN_URL', 'PLUGINDIR', 'WPMU_PLUGIN_DIR', 'WPMU_PLUGIN_URL', 'MUPLUGINDIR' );
 
 // Load must-use plugins.
 foreach ( wp_load_mu_plugins() as $mu_plugin ) {
@@ -150,12 +155,19 @@
 		die();
 	}
 	unset($file);
-	ms_default_constants( 'cookies' );
+	ms_default_constants( 'COOKIEPATH', 'SITECOOKIEPATH', 'ADMIN_COOKIE_PATH', 'COOKIE_DOMAIN' );
 }
 
 // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
-wp_default_constants( 'ms_loaded' );
+wp_default_constants( '$wp_default_secret_key', 'COOKIEHASH', 'USER_COOKIE', 'PASS_COOKIE', 'AUTH_COOKIE', 'SECURE_AUTH_COOKIE',
+	'LOGGED_IN_COOKIE', 'TEST_COOKIE', 'COOKIEPATH', 'SITECOOKIEPATH', 'ADMIN_COOKIE_PATH', 'PLUGINS_COOKIE_PATH', 'COOKIE_DOMAIN',
+	'FORCE_SSL_ADMIN', 'FORCE_SSL_LOGIN', 'AUTOSAVE_INTERVAL', 'EMPTY_TRASH_DAYS' );
 
+/** Check if SSL admin. */
+force_ssl_admin( FORCE_SSL_ADMIN );
+/** Check if SSL login. */
+force_ssl_login( FORCE_SSL_LOGIN );
+
 // Create common globals.
 require( ABSPATH . WPINC . '/vars.php' );
 
@@ -181,7 +193,7 @@
 do_action( 'plugins_loaded' );
 
 // Define WP_POST_REVISIONS if not already defined.
-wp_default_constants( 'plugins_loaded' );
+wp_default_constants( 'WP_POST_REVISONS' );
 
 // Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
 wp_magic_quotes();
@@ -227,7 +239,7 @@
 do_action( 'setup_theme' );
 
 // Define the TEMPLATEPATH and STYLESHEETPATH constants.
-wp_default_constants( 'setup_theme' );
+wp_default_constants( 'TEMPLATEPATH', 'STYLESHEETPATH' );
 
 // Load the default text localization domain.
 load_default_textdomain();
