Changeset 12688
- Timestamp:
- 01/10/2010 06:10:51 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-settings.php
r12685 r12688 10 10 */ 11 11 12 if ( !defined('WP_MEMORY_LIMIT') ) 13 define('WP_MEMORY_LIMIT', '32M'); 12 13 /** 14 * Whether Multisite support is enabled 15 * 16 * @since 3.0 17 * 18 * @return bool True if multisite is enabled, false otherwise. 19 */ 20 function is_multisite() { 21 if ( ( defined('MULTISITE') && MULTISITE ) || defined('VHOST') || defined('SUNRISE') ) 22 return true; 23 24 return false; 25 } 26 27 if ( !defined('WP_MEMORY_LIMIT') ) { 28 if( is_multisite() ) { 29 define('WP_MEMORY_LIMIT', '64M'); 30 } else { 31 define('WP_MEMORY_LIMIT', '32M'); 32 } 33 } 14 34 15 35 if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) ) … … 326 346 } 327 347 328 /**329 * Whether Multisite support is enabled330 *331 * @since 3.0332 *333 * @return bool True if multisite is enabled, false otherwise.334 */335 function is_multisite() {336 if ( ( defined('MULTISITE') && MULTISITE ) || defined('VHOST') )337 return true;338 339 return false;340 }341 342 348 if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) { 343 349 require_once (WP_CONTENT_DIR . '/object-cache.php'); … … 350 356 wp_cache_init(); 351 357 if ( function_exists('wp_cache_add_global_groups') ) { 352 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient')); 358 if( is_multisite() ) { 359 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss')); 360 } else { 361 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient')); 362 } 353 363 wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); 364 } 365 366 if( is_multisite() ) { 367 require (ABSPATH . WPINC . '/ms-load.php'); 354 368 } 355 369 … … 357 371 require (ABSPATH . WPINC . '/default-filters.php'); 358 372 include_once(ABSPATH . WPINC . '/pomo/mo.php'); 373 374 if( is_multisite() && defined( "SHORTINIT" ) && SHORTINIT ) // stop most of WP being loaded, we just want the basics 375 return false; 376 359 377 require_once (ABSPATH . WPINC . '/l10n.php'); 360 378 361 if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { 379 if( is_multisite() ) { 380 if ( !is_blog_installed() && !defined('WP_INSTALLING') ) { 381 die( __( 'The blog you have requested is not installed properly. Please contact the system administrator.' ) ); // have to die here ~ Mark 382 } 383 } elseif ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { 362 384 if ( defined('WP_SITEURL') ) 363 385 $link = WP_SITEURL . '/wp-admin/install.php'; … … 438 460 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. 439 461 462 if( is_multisite() ) 463 ms_network_settings(); 440 464 /** 441 465 * Allows for the mu-plugins directory to be moved from the default location. … … 464 488 if ( is_dir( WPMU_PLUGIN_DIR ) ) { 465 489 if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) { 466 while ( ( $plugin = readdir( $dh ) ) !== false ) { 467 if ( substr( $plugin, -4 ) == '.php' ) { 468 include_once( WPMU_PLUGIN_DIR . '/' . $plugin ); 469 } 470 } 490 $mu_plugins = array (); 491 while ( ( $plugin = readdir( $dh ) ) !== false ) 492 if ( substr( $plugin, -4 ) == '.php' ) 493 $mu_plugins[] = $plugin; 494 closedir( $dh ); 495 if( is_multisite() ) 496 sort( $mu_plugins ); 497 foreach( $mu_plugins as $mu_plugin ) 498 include_once( WPMU_PLUGIN_DIR . '/' . $mu_plugin ); 471 499 } 472 500 } 501 /** 502 * Used to load network wide plugins 503 * @since 3.0 504 */ 505 if( is_multisite() ) 506 ms_network_plugins(); 507 473 508 do_action('muplugins_loaded'); 474 509 510 /** 511 * Used to check site status 512 * @since 3.0 513 */ 514 if( is_multisite() ) { 515 ms_site_check(); 516 ms_network_cookies(); 517 } 475 518 /** 476 519 * Used to guarantee unique hash cookies 477 520 * @since 1.5 478 521 */ 479 define('COOKIEHASH', md5(get_option('siteurl'))); 522 if( !defined('COOKIEHASH') ) 523 define('COOKIEHASH', md5(get_option('siteurl'))); 480 524 481 525 /**
Note: See TracChangeset
for help on using the changeset viewer.