Ticket #11881: default-constants.diff
File default-constants.diff, 25.4 KB (added by , 15 years ago) |
---|
-
wp-admin/load-scripts.php
99 99 if ( empty($load) ) 100 100 exit; 101 101 102 require(ABSPATH . WPINC . '/script-loader.php'); 103 require(ABSPATH . WPINC . '/version.php'); 102 require( ABSPATH . WPINC . '/default-constants.php' ); 103 require( ABSPATH . WPINC . '/script-loader.php' ); 104 require( ABSPATH . WPINC . '/version.php' ); 104 105 105 106 $compress = ( isset($_GET['c']) && $_GET['c'] ); 106 107 $force_gzip = ( $compress && 'gzip' == $_GET['c'] ); -
wp-admin/load-styles.php
93 93 return @file_get_contents($path); 94 94 } 95 95 96 require(ABSPATH . '/wp-includes/script-loader.php'); 97 require(ABSPATH . '/wp-includes/version.php'); 96 require( ABSPATH . WPINC . '/default-constants.php' ); 97 require( ABSPATH . WPINC . '/script-loader.php' ); 98 require( ABSPATH . WPINC . '/version.php'); 98 99 99 100 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] ); 100 101 $load = explode(',', $load); -
wp-includes/default-constants.php
9 9 * Defines WordPress default constants. 10 10 * 11 11 * @since 3.0.0 12 * @param $con text12 * @param $constants Constants to define. 13 13 */ 14 function wp_default_constants( $context ) { 14 function wp_default_constants( $constants ) { 15 if ( ! is_array( $constants ) ) 16 $constants = func_get_args(); 15 17 16 switch( $context ) { 18 foreach ( $constants as $constant ) : 19 if ( defined( $constant ) ) { 20 continue; 21 } elseif ( '$' == substr( $constant, 0, 1 ) ) { // the rare variable 22 $var = substr( $constant, 1 ); 23 if ( isset( $$var ) ) 24 continue; 25 global $$var; 26 } 17 27 18 case 'init' : 19 20 // set memory limits 21 if ( !defined('WP_MEMORY_LIMIT') ) { 22 if( is_multisite() ) { 23 define('WP_MEMORY_LIMIT', '64M'); 24 } else { 25 define('WP_MEMORY_LIMIT', '32M'); 26 } 27 } 28 29 /** 30 * The $blog_id global, which you can change in the config allows you to create a simple 31 * multiple blog installation using just one WordPress and changing $blog_id around. 32 * 33 * @global int $blog_id 34 * @since 2.0.0 35 */ 36 if ( ! isset($blog_id) ) 28 switch( $constant ) : 29 case 'WP_MEMORY_LIMIT' : 30 if ( is_multisite() ) 31 define( 'WP_MEMORY_LIMIT', '64M' ); 32 else 33 define( 'WP_MEMORY_LIMIT', '32M' ); 34 break; 35 case '$blog_id' : 36 /** 37 * The $blog_id global, which you can change in the config allows you to create a simple 38 * multiple blog installation using just one WordPress and changing $blog_id around. 39 * 40 * @global int $blog_id 41 * @since 2.0.0 42 */ 37 43 $blog_id = 1; 38 39 // set memory limits. 40 if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) ) 41 @ini_set('memory_limit', WP_MEMORY_LIMIT); 42 43 if ( !defined('WP_CONTENT_DIR') ) 44 break; 45 case 'WP_CONTENT_DIR' : 44 46 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down 45 46 // Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development. 47 if ( !defined('WP_DEBUG') ) 47 break; 48 case 'WP_DEBUG' : 49 /** 50 * Add define( 'WP_DEBUG', true ); to wp-config.php to enable display of notices during development. 51 */ 48 52 define( 'WP_DEBUG', false ); 49 50 // 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 51 if ( !defined('WP_DEBUG_DISPLAY') ) 53 break; 54 case 'WP_DEBUG_DISPLAY' : 55 /** 56 * 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. 57 * @since 2.9.0 58 */ 52 59 define( 'WP_DEBUG_DISPLAY', true ); 53 54 // Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log 55 if ( !defined('WP_DEBUG_LOG') ) 56 define('WP_DEBUG_LOG', false); 57 58 if ( !defined('WP_CACHE') ) 59 define('WP_CACHE', false); 60 61 /** 62 * Private 63 */ 64 if ( !defined('MEDIA_TRASH') ) 65 define('MEDIA_TRASH', false); 66 67 if ( !defined('SHORTINIT') ) 68 define('SHORTINIT', false); 69 break; 70 71 case 'wp_included': 72 73 if ( !defined('WP_CONTENT_URL') ) 74 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up 75 76 /** 77 * Allows for the plugins directory to be moved from the default location. 78 * 79 * @since 2.6.0 80 */ 81 if ( !defined('WP_PLUGIN_DIR') ) 60 break; 61 case 'WP_DEBUG_LOG' : 62 /** 63 * Add define( 'WP_DEBUG_LOG', true ); to wp-config.php to enable PHP debug logging to wp-content/debug.log. 64 * @since 2.9.0 65 */ 66 define( 'WP_DEBUG_LOG', false ); 67 break; 68 case 'WP_CACHE' : 69 /** 70 * External object cache support. 71 */ 72 define( 'WP_CACHE', false ); 73 break; 74 case 'MEDIA_TRASH' : 75 define( 'MEDIA_TRASH', false ); 76 break; 77 case 'SHORTINIT' : 78 define( 'SHORTINIT', false ); 79 break; 80 case 'WP_CONTENT_URL' : 81 if ( defined( 'WP_CONTENT_DIR' ) ) 82 define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // full url - WP_CONTENT_DIR is defined further up 83 else 84 define( 'WP_CONTENT_URL', '' ); // for script-loader.php 85 break; 86 case 'WP_PLUGIN_DIR' : 87 /** 88 * Allows for the plugins directory to be moved from the default location. 89 * @since 2.6.0 90 */ 82 91 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash 83 84 /** 85 * Allows for the plugins directory to be moved from the default location. 86 * 87 * @since 2.6.0 88 */ 89 if ( !defined('WP_PLUGIN_URL') ) 92 break; 93 case 'WP_PLUGIN_URL' : 94 /** 95 * Allows for the plugins directory to be moved from the default location. 96 * @since 2.6.0 97 */ 90 98 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash 91 92 /** 93 * Allows for the plugins directory to be moved from the default location. 94 * 95 * @since 2.1.0 96 * @deprecated 97 */ 98 if ( !defined('PLUGINDIR') ) 99 break; 100 case 'PLUGINDIR' : 101 /** 102 * Allows for the plugins directory to be moved from the default location. 103 * @since 2.1.0 104 * @deprecated 105 */ 99 106 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. 100 101 /** 102 * Allows for the mu-plugins directory to be moved from the default location. 103 * 104 * @since 2.8.0 105 */ 106 if ( !defined('WPMU_PLUGIN_DIR') ) 107 break; 108 case 'WPMU_PLUGIN_DIR' : 109 /** 110 * Allows for the mu-plugins directory to be moved from the default location. 111 * @since 2.8.0 112 */ 107 113 define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash 108 109 /** 110 * Allows for the mu-plugins directory to be moved from the default location. 111 * 112 * @since 2.8.0 113 */ 114 if ( !defined('WPMU_PLUGIN_URL') ) 114 break; 115 case 'WPMU_PLUGIN_URL' : 116 /** 117 * Allows for the mu-plugins directory to be moved from the default location. 118 * @since 2.8.0 119 */ 115 120 define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash 116 117 /** 118 * Allows for the mu-plugins directory to be moved from the default location. 119 * 120 * @since 2.8.0 121 * @deprecated 122 */ 123 if ( !defined( 'MUPLUGINDIR' ) ) 121 break; 122 case 'MUPLUGINDIR' : 123 /** 124 * Allows for the mu-plugins directory to be moved from the default location. 125 * @since 2.8.0 126 * @deprecated 127 */ 124 128 define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. 125 break; 126 127 case 'ms_loaded'; 128 129 global $wp_default_secret_key; 130 131 /** 132 * Used to guarantee unique hash cookies 133 * @since 1.5 134 */ 135 if ( !defined( 'COOKIEHASH' ) ) { 136 $siteurl = get_site_option( 'siteurl' ); 137 if ( $siteurl ) 129 break; 130 case '$wp_default_secret_key' : 131 /** 132 * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php 133 * @since 2.5.0 134 */ 135 $wp_default_secret_key = 'put your unique phrase here'; 136 break; 137 case 'COOKIEHASH' : 138 /** 139 * Used to guarantee unique hash cookies 140 * @since 1.5 141 */ 142 if ( $siteurl = get_site_option( 'siteurl' ) ) 138 143 define( 'COOKIEHASH', md5( $siteurl ) ); 139 144 else 140 145 define( 'COOKIEHASH', '' ); 141 } 142 143 /** 144 * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php 145 * @since 2.5.0 146 */ 147 $wp_default_secret_key = 'put your unique phrase here'; 148 149 /** 150 * @since 2.0.0 151 */ 152 if ( !defined('USER_COOKIE') ) 153 define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); 154 155 /** 156 * @since 2.0.0 157 */ 158 if ( !defined('PASS_COOKIE') ) 159 define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); 160 161 /** 162 * @since 2.5.0 163 */ 164 if ( !defined('AUTH_COOKIE') ) 165 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); 166 167 /** 168 * @since 2.6.0 169 */ 170 if ( !defined('SECURE_AUTH_COOKIE') ) 171 define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); 172 173 /** 174 * @since 2.6.0 175 */ 176 if ( !defined('LOGGED_IN_COOKIE') ) 177 define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); 178 179 /** 180 * @since 2.3.0 181 */ 182 if ( !defined('TEST_COOKIE') ) 183 define('TEST_COOKIE', 'wordpress_test_cookie'); 184 185 /** 186 * @since 1.2.0 187 */ 188 if ( !defined('COOKIEPATH') ) 189 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); 190 191 /** 192 * @since 1.5.0 193 */ 194 if ( !defined('SITECOOKIEPATH') ) 195 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); 196 197 /** 198 * @since 2.6.0 199 */ 200 if ( !defined('ADMIN_COOKIE_PATH') ) 146 break; 147 case 'USER_COOKIE' : 148 /** 149 * @since 2.0.0 150 */ 151 define( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH ); 152 break; 153 case 'PASS_COOKIE' : 154 /** 155 * @since 2.0.0 156 */ 157 define( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH ); 158 break; 159 case 'AUTH_COOKIE' : 160 /** 161 * @since 2.5.0 162 */ 163 define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH ); 164 break; 165 case 'SECURE_AUTH_COOKIE' : 166 /** 167 * @since 2.6.0 168 */ 169 define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH ); 170 break; 171 case 'LOGGED_IN_COOKIE' : 172 /** 173 * @since 2.6.0 174 */ 175 define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH ); 176 break; 177 case 'TEST_COOKIE' : 178 /** 179 * @since 2.3.0 180 */ 181 define( 'TEST_COOKIE', 'wordpress_test_cookie' ); 182 break; 183 case 'COOKIEPATH' : 184 /** 185 * @since 1.2.0 186 */ 187 define( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'home' ) . '/' ) ); 188 break; 189 case 'SITECOOKIEPATH' : 190 /** 191 * @since 1.5.0 192 */ 193 define( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'siteurl' ) . '/' ) ); 194 break; 195 case 'ADMIN_COOKIE_PATH' : 196 /** 197 * @since 2.6.0 198 */ 201 199 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); 202 203 /** 204 * @since 2.6.0 205 */ 206 if ( !defined('PLUGINS_COOKIE_PATH') ) 207 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); 208 209 /** 210 * @since 2.0.0 211 */ 212 if ( !defined('COOKIE_DOMAIN') ) 213 define('COOKIE_DOMAIN', false); 214 215 /** 216 * @since 2.6.0 217 */ 218 if ( !defined('FORCE_SSL_ADMIN') ) 219 define('FORCE_SSL_ADMIN', false); 220 force_ssl_admin(FORCE_SSL_ADMIN); 221 222 /** 223 * @since 2.6.0 224 */ 225 if ( !defined('FORCE_SSL_LOGIN') ) 226 define('FORCE_SSL_LOGIN', false); 227 force_ssl_login(FORCE_SSL_LOGIN); 228 229 /** 230 * @since 2.5.0 231 */ 232 if ( !defined( 'AUTOSAVE_INTERVAL' ) ) 200 break; 201 case 'PLUGINS_COOKIE_PATH' : 202 /** 203 * @since 2.6.0 204 */ 205 define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) ); 206 break; 207 case 'COOKIE_DOMAIN' : 208 /** 209 * @since 2.0.0 210 */ 211 define( 'COOKIE_DOMAIN', false ); 212 break; 213 case 'FORCE_SSL_ADMIN' : 214 /** 215 * @since 2.6.0 216 */ 217 define( 'FORCE_SSL_ADMIN', false ); 218 break; 219 case 'FORCE_SSL_LOGIN' : 220 /** 221 * @since 2.6.0 222 */ 223 define( 'FORCE_SSL_LOGIN', false ); 224 break; 225 case 'AUTOSAVE_INTERVAL' : 226 /** 227 * @since 2.5.0 228 */ 233 229 define( 'AUTOSAVE_INTERVAL', 60 ); 234 235 /**236 * @since 2.9.0237 */238 if ( !defined( 'EMPTY_TRASH_DAYS' ) )230 break; 231 case 'EMPTY_TRASH_DAYS' : 232 /** 233 * @since 2.9.0 234 */ 239 235 define( 'EMPTY_TRASH_DAYS', 30 ); 240 break; 241 242 case 'plugins_loaded': 243 244 if ( !defined('WP_POST_REVISIONS') ) 245 define('WP_POST_REVISIONS', true); 246 break; 247 248 case 'setup_theme': 249 250 /** 251 * Web Path to the current active template directory 252 * @since 1.5.0 253 */ 254 define('TEMPLATEPATH', get_template_directory()); 255 256 /** 257 * Web Path to the current active template stylesheet directory 258 * @since 2.1.0 259 */ 260 define('STYLESHEETPATH', get_stylesheet_directory()); 261 break; 262 263 } 264 236 break; 237 case 'WP_POST_REVISIONS' : 238 define( 'WP_POST_REVISIONS', true ); 239 break; 240 case 'TEMPLATEPATH' : 241 /** 242 * Web Path to the current active template directory 243 * @since 1.5.0 244 */ 245 define( 'TEMPLATEPATH', get_template_directory() ); 246 break; 247 case 'STYLESHEETPATH' : 248 /** 249 * Web Path to the current active template stylesheet directory 250 * @since 2.1.0 251 */ 252 define( 'STYLESHEETPATH', get_stylesheet_directory() ); 253 break; 254 case 'SCRIPT_DEBUG' : 255 define( 'SCRIPT_DEBUG', false ); 256 break; 257 case 'STYLE_DEBUG' : 258 define( 'STYLE_DEBUG', false ); 259 break; 260 case 'CONCATENATE_SCRIPTS' : 261 define( 'CONCATENATE_SCRIPTS', true ); 262 break; 263 case 'COMPRESS_SCRIPTS' : 264 define( 'COMPRESS_SCRIPTS', true ); 265 break; 266 case 'COMPRESS_CSS' : 267 define( 'COMPRESS_CSS', true ); 268 break; 269 case 'ENFORCE_GZIP' : 270 define( 'ENFORCE_GZIP', false ); 271 break; 272 endswitch; 273 endforeach; 265 274 } 266 275 267 276 ?> -
wp-includes/ms-default-constants.php
10 10 * Defines Multisite default constants. 11 11 * 12 12 * @since 3.0.0 13 * @param $con text13 * @param $constants Constants to define 14 14 */ 15 function ms_default_constants( $context ) { 16 switch( $context ) { 17 case 'uploads' : 18 global $wpdb; 19 /** @since 3.0.0 */ 20 if ( !defined( 'UPLOADBLOGSDIR' ) ) 15 function ms_default_constants( $constants ) { 16 global $wpdb, $current_site; 17 if ( ! is_array( $constants ) ) 18 $constants = func_get_args(); 19 20 foreach ( $constants as $constant ) : 21 if ( defined( $constant ) ) 22 continue; 23 24 switch( $constant ) : 25 case 'UPLOADBLOGSDIR' : 26 /** @since 3.0.0 */ 21 27 define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); 22 /** @since 3.0.0 */ 23 if ( !defined( 'UPLOADS' ) ) 28 break; 29 case 'UPLOADS' : 30 /** @since 3.0.0 */ 24 31 define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); 25 /** @since 3.0.0 */ 26 if ( !defined( 'BLOGUPLOADDIR' ) ) 32 break; 33 case 'BLOGUPLOADDIR' : 34 /** @since 3.0.0 */ 27 35 define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); 28 break; 29 case 'cookies' : 30 global $current_site; 31 /** 32 * @since 1.2.0 33 */ 34 if ( !defined( 'COOKIEPATH' ) ) 35 define( 'COOKIEPATH', $current_site->path ); 36 /** 37 * @since 1.5.0 38 */ 39 if ( !defined( 'SITECOOKIEPATH' ) ) 40 define( 'SITECOOKIEPATH', $current_site->path ); 41 /** 42 * @since 2.6.0 43 */ 44 if ( !defined( 'ADMIN_COOKIE_PATH' ) ) { 45 if( !is_subdomain_install() ) { 46 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH ); 47 } else { 48 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); 49 } 50 } 51 /** 52 * @since 2.0.0 53 */ 54 if ( !defined('COOKIE_DOMAIN') ) 55 define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain); 56 break; 57 case 'ms-files' : 58 /** 59 * Optional support for X-Sendfile header 60 * @since 3.0.0 61 */ 62 if ( !defined( 'WPMU_SENDFILE' ) ) 36 break; 37 case 'COOKIEPATH' : 38 /** @since 1.2.0 */ 39 define( 'COOKIEPATH', $current_site->path ); 40 break; 41 case 'SITECOOKIEPATH' : 42 /** @since 1.5.0 */ 43 define( 'SITECOOKIEPATH', $current_site->path ); 44 break; 45 case 'ADMIN_COOKIE_PATH' : 46 /** @since 2.6.0 */ 47 if( ! is_subdomain_install() ) 48 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH ); 49 else 50 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); 51 break; 52 case 'COOKIE_DOMAIN' : 53 /** @since 2.0.0 */ 54 define( 'COOKIE_DOMAIN', '.' . $current_site->cookie_domain ); 55 break; 56 case 'WPMU_SENDFILE' : 57 /** 58 * Optional support for X-Sendfile header 59 * @since 3.0.0 60 */ 63 61 define( 'WPMU_SENDFILE', false ); 64 /** 65 * Optional support for X-Accel-Redirect header 66 * @since 3.0.0 67 */ 68 if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) 62 break; 63 case 'WPMU_ACCEL_REDIRECT' : 64 /** 65 * Optional support for X-Accel-Redirect header 66 * @since 3.0.0 67 */ 69 68 define( 'WPMU_ACCEL_REDIRECT', false ); 70 break; 71 } 69 break; 70 endswitch; 71 endforeach; 72 72 } 73 73 ?> 74 No newline at end of file -
wp-includes/ms-files.php
10 10 11 11 define( 'SHORTINIT', true ); 12 12 require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); 13 ms_default_constants( ' ms-files' );13 ms_default_constants( 'WPMU_SENDFILE', 'WPMU_ACCEL_REDIRECT' ); 14 14 15 15 error_reporting(0); 16 16 -
wp-includes/ms-settings.php
124 124 wp_start_object_cache(); 125 125 126 126 // Define upload directory constants 127 ms_default_constants( ' uploads' );127 ms_default_constants( 'UPLOADBLOGSDIR', 'UPLOADS', 'BLOGUPLOADDIR' ); 128 128 129 129 ?> -
wp-includes/script-loader.php
37 37 /** BackPress: WordPress Styles Functions */ 38 38 require( ABSPATH . WPINC . '/functions.wp-styles.php' ); 39 39 40 /** Define default constants. */ 41 wp_default_constants( 'WP_CONTENT_URL', 'SCRIPT_DEBUG', 'STYLE_DEBUG', 'CONCATENATE_SCRIPTS', 'COMPRESS_SCRIPTS', 'COMPRESS_CSS', 'ENFORCE_GZIP' ); 42 40 43 /** 41 44 * Setup WordPress scripts to load by default for Administration Panels. 42 45 * … … 53 56 $guessurl = wp_guess_url(); 54 57 55 58 $scripts->base_url = $guessurl; 56 $scripts->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';59 $scripts->content_url = WP_CONTENT_URL; 57 60 $scripts->default_version = get_bloginfo( 'version' ); 58 61 $scripts->default_dirs = array('/wp-admin/js/', '/wp-includes/js/'); 59 62 60 $suffix = defined('SCRIPT_DEBUG') &&SCRIPT_DEBUG ? '.dev' : '';63 $suffix = SCRIPT_DEBUG ? '.dev' : ''; 61 64 62 65 $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' ); 63 66 … … 187 190 $scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2201'); 188 191 $scripts->add( 'swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array('swfupload'), '2201'); 189 192 190 if ( defined('SCRIPT_DEBUG') &&SCRIPT_DEBUG ) {193 if ( SCRIPT_DEBUG ) { 191 194 // queue all SWFUpload scripts that are used by default 192 195 $scripts->add( 'swfupload-all', false, array('swfupload', 'swfupload-swfobject', 'swfupload-queue'), '2201'); 193 196 } else { … … 419 422 $guessurl = wp_guess_url(); 420 423 421 424 $styles->base_url = $guessurl; 422 $styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';425 $styles->content_url = WP_CONTENT_URL; 423 426 $styles->default_version = get_bloginfo( 'version' ); 424 427 $styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr'; 425 428 $styles->default_dirs = array('/wp-admin/'); 426 429 427 $suffix = defined('STYLE_DEBUG') &&STYLE_DEBUG ? '.dev' : '';430 $suffix = STYLE_DEBUG ? '.dev' : ''; 428 431 429 432 $rtl_styles = array( 'wp-admin', 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' ); 430 433 … … 544 547 $parsed = parse_url( $src ); 545 548 $url = $color->url; 546 549 547 if ( defined('STYLE_DEBUG') &&STYLE_DEBUG )550 if ( STYLE_DEBUG ) 548 551 $url = preg_replace('/.css$|.css(?=\?)/', '.dev.css', $url); 549 552 550 553 if ( isset($parsed['query']) && $parsed['query'] ) { … … 616 619 global $wp_scripts, $compress_scripts; 617 620 618 621 $zip = $compress_scripts ? 1 : 0; 619 if ( $zip && defined('ENFORCE_GZIP') &&ENFORCE_GZIP )622 if ( $zip && ENFORCE_GZIP ) 620 623 $zip = 'gzip'; 621 624 622 625 if ( !empty($wp_scripts->concat) ) { … … 688 691 script_concat_settings(); 689 692 $wp_styles->do_concat = $concatenate_scripts; 690 693 $zip = $compress_css ? 1 : 0; 691 if ( $zip && defined('ENFORCE_GZIP') &&ENFORCE_GZIP )694 if ( $zip && ENFORCE_GZIP ) 692 695 $zip = 'gzip'; 693 696 694 697 $wp_styles->do_items(false); … … 716 719 $compressed_output = ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ); 717 720 718 721 if ( ! isset($concatenate_scripts) ) { 719 $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;720 if ( ! is_admin() || ( defined('SCRIPT_DEBUG') &&SCRIPT_DEBUG ) )722 $concatenate_scripts = CONCATENATE_SCRIPTS; 723 if ( ! is_admin() || ( SCRIPT_DEBUG ) ) 721 724 $concatenate_scripts = false; 722 725 } 723 726 724 727 if ( ! isset($compress_scripts) ) { 725 $compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;728 $compress_scripts = COMPRESS_SCRIPTS; 726 729 if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) 727 730 $compress_scripts = false; 728 731 } 729 732 730 733 if ( ! isset($compress_css) ) { 731 $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;734 $compress_css = COMPRESS_CSS; 732 735 if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) 733 736 $compress_css = false; 734 737 } -
wp-settings.php
20 20 require( ABSPATH . WPINC . '/default-constants.php' ); 21 21 require( ABSPATH . WPINC . '/version.php' ); 22 22 23 // Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. 24 wp_default_constants( 'init' ); 23 // Set initial default constants and $blog_id. 24 wp_default_constants( 'WP_MEMORY_LIMIT', '$blog_id', 'WP_CONTENT_DIR', 'WP_DEBUG', 'WP_DEBUG_DISPLAY', 25 'WP_DEBUG_LOG', 'WP_CACHE', 'MEDIA_TRASH', 'SHORTINIT' ); 25 26 27 // set memory limits. 28 if ( function_exists( 'memory_get_usage' ) && ( (int) @ini_get('memory_limit') < abs( intval(WP_MEMORY_LIMIT ) ) ) ) 29 @ini_set( 'memory_limit', WP_MEMORY_LIMIT ); 30 26 31 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. 27 32 set_magic_quotes_runtime( 0 ); 28 33 @ini_set( 'magic_quotes_sybase', 0 ); … … 133 138 134 139 // Define constants that rely on the API to obtain the default value. 135 140 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. 136 wp_default_constants( ' wp_included' );141 wp_default_constants( 'WP_CONTENT_URL', 'WP_PLUGIN_DIR', 'WP_PLUGIN_URL', 'PLUGINDIR', 'WPMU_PLUGIN_DIR', 'WPMU_PLUGIN_URL', 'MUPLUGINDIR' ); 137 142 138 143 // Load must-use plugins. 139 144 foreach ( wp_load_mu_plugins() as $mu_plugin ) { … … 150 155 die(); 151 156 } 152 157 unset($file); 153 ms_default_constants( ' cookies' );158 ms_default_constants( 'COOKIEPATH', 'SITECOOKIEPATH', 'ADMIN_COOKIE_PATH', 'COOKIE_DOMAIN' ); 154 159 } 155 160 156 161 // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). 157 wp_default_constants( 'ms_loaded' ); 162 wp_default_constants( '$wp_default_secret_key', 'COOKIEHASH', 'USER_COOKIE', 'PASS_COOKIE', 'AUTH_COOKIE', 'SECURE_AUTH_COOKIE', 163 'LOGGED_IN_COOKIE', 'TEST_COOKIE', 'COOKIEPATH', 'SITECOOKIEPATH', 'ADMIN_COOKIE_PATH', 'PLUGINS_COOKIE_PATH', 'COOKIE_DOMAIN', 164 'FORCE_SSL_ADMIN', 'FORCE_SSL_LOGIN', 'AUTOSAVE_INTERVAL', 'EMPTY_TRASH_DAYS' ); 158 165 166 /** Check if SSL admin. */ 167 force_ssl_admin( FORCE_SSL_ADMIN ); 168 /** Check if SSL login. */ 169 force_ssl_login( FORCE_SSL_LOGIN ); 170 159 171 // Create common globals. 160 172 require( ABSPATH . WPINC . '/vars.php' ); 161 173 … … 181 193 do_action( 'plugins_loaded' ); 182 194 183 195 // Define WP_POST_REVISIONS if not already defined. 184 wp_default_constants( ' plugins_loaded' );196 wp_default_constants( 'WP_POST_REVISONS' ); 185 197 186 198 // Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) 187 199 wp_magic_quotes(); … … 227 239 do_action( 'setup_theme' ); 228 240 229 241 // Define the TEMPLATEPATH and STYLESHEETPATH constants. 230 wp_default_constants( ' setup_theme' );242 wp_default_constants( 'TEMPLATEPATH', 'STYLESHEETPATH' ); 231 243 232 244 // Load the default text localization domain. 233 245 load_default_textdomain();