Changes from branches/3.0/wp-includes/load.php at r15967 to trunk/wp-includes/load.php at r17194
- File:
-
- 1 edited
-
trunk/wp-includes/load.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/load.php
r15967 r17194 257 257 function wp_debug_mode() { 258 258 if ( WP_DEBUG ) { 259 // E_DEPRECATED is a core PHP constant in PHP 5.3. Don't define this yourself. 260 // The two statements are equivalent, just one is for 5.3+ and for less than 5.3. 259 261 if ( defined( 'E_DEPRECATED' ) ) 260 262 error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT ); … … 309 311 310 312 /** 313 * Load the correct database class file. 314 * 315 * This function is used to load the database class file either at runtime or by 316 * wp-admin/setup-config.php. We must globalize $wpdb to ensure that it is 317 * defined globally by the inline code in wp-db.php. 318 * 319 * @since 2.5.0 320 * @global $wpdb WordPress Database Object 321 */ 322 function require_wp_db() { 323 global $wpdb; 324 325 require_once( ABSPATH . WPINC . '/wp-db.php' ); 326 if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) 327 require_once( WP_CONTENT_DIR . '/db.php' ); 328 329 if ( isset( $wpdb ) ) 330 return; 331 332 $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST ); 333 } 334 335 /** 311 336 * Sets the database table prefix and the format specifiers for database table columns. 312 337 * … … 379 404 380 405 if ( function_exists( 'wp_cache_add_global_groups' ) ) { 381 wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', ' site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );406 wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) ); 382 407 wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); 383 408 } … … 397 422 wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); 398 423 } elseif ( ! is_blog_installed() && false === strpos( $_SERVER['PHP_SELF'], 'install.php' ) && !defined( 'WP_INSTALLING' ) ) { 399 if ( defined( 'WP_SITEURL' ) ) 400 $link = WP_SITEURL . '/wp-admin/install.php'; 401 elseif ( false !== strpos( $_SERVER['PHP_SELF'], 'wp-admin' ) ) 402 $link = preg_replace( '|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php'; 403 else 404 $link = preg_replace( '|/[^/]+?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php'; 424 425 $link = wp_guess_url() . '/wp-admin/install.php'; 426 405 427 require( ABSPATH . WPINC . '/kses.php' ); 406 428 require( ABSPATH . WPINC . '/pluggable.php' ); … … 453 475 $active_plugins = (array) get_option( 'active_plugins', array() ); 454 476 455 // Get active network plugins456 if ( is_multisite() ) {457 $active_sitewide_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );458 if ( !empty($active_sitewide_plugins) ) {459 $active_plugins = array_merge( $active_plugins, array_keys( $active_sitewide_plugins ) );460 sort( $active_plugins );461 }462 }463 464 477 // Check for hacks file if the option is enabled 465 478 if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { … … 471 484 return $plugins; 472 485 486 $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false; 487 473 488 foreach ( $active_plugins as $plugin ) { 474 489 if ( ! validate_file( $plugin ) // $plugin must validate as file 475 490 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 476 491 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 492 // not already included as a network plugin 493 && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) ) 477 494 ) 478 495 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; … … 554 571 555 572 /** 556 * Whether the current request is in WordPress admin Panel573 * Whether the current request is for a network or blog admin page 557 574 * 558 575 * Does not inform on whether the user is an admin! Use capability checks to … … 570 587 571 588 /** 589 * Whether the current request is for a blog admin screen /wp-admin/ 590 * 591 * Does not inform on whether the user is a blog admin! Use capability checks to 592 * tell if the user should be accessing a section or not. 593 * 594 * @since 3.1.0 595 * 596 * @return bool True if inside WordPress network administration pages. 597 */ 598 function is_blog_admin() { 599 if ( defined( 'WP_BLOG_ADMIN' ) ) 600 return WP_BLOG_ADMIN; 601 return false; 602 } 603 604 /** 605 * Whether the current request is for a network admin screen /wp-admin/network/ 606 * 607 * Does not inform on whether the user is a network admin! Use capability checks to 608 * tell if the user should be accessing a section or not. 609 * 610 * @since 3.1.0 611 * 612 * @return bool True if inside WordPress network administration pages. 613 */ 614 function is_network_admin() { 615 if ( defined( 'WP_NETWORK_ADMIN' ) ) 616 return WP_NETWORK_ADMIN; 617 return false; 618 } 619 620 /** 621 * Whether the current request is for a user admin screen /wp-admin/user/ 622 * 623 * Does not inform on whether the user is an admin! Use capability checks to 624 * tell if the user should be accessing a section or not. 625 * 626 * @since 3.1.0 627 * 628 * @return bool True if inside WordPress user administration pages. 629 */ 630 function is_user_admin() { 631 if ( defined( 'WP_USER_ADMIN' ) ) 632 return WP_USER_ADMIN; 633 return false; 634 } 635 636 /** 572 637 * Whether Multisite support is enabled 573 638 *
Note: See TracChangeset
for help on using the changeset viewer.