Make WordPress Core


Ignore:
Timestamp:
01/19/2010 05:27:03 PM (14 years ago)
Author:
ryan
Message:

phpdoc for load.php, return some includes to global scope. Props nacin. see #11881

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-load.php

    r12730 r12762  
    1414    include_once( WP_CONTENT_DIR . '/sunrise.php' );
    1515
    16     require (ABSPATH . WPINC . '/ms-settings.php');
    17 $wpdb->blogid           = $current_blog->blog_id;
    18 $wpdb->siteid           = $current_blog->site_id;
     16    require( ABSPATH . WPINC . '/ms-settings.php' );
     17$wpdb->blogid = $current_blog->blog_id;
     18$wpdb->siteid = $current_blog->site_id;
    1919$wpdb->set_prefix($table_prefix); // set up blog tables
    2020$table_prefix = $wpdb->get_blog_prefix();
     
    4141
    4242function ms_network_settings() {
    43         global $wpdb, $current_site, $cookiehash;
     43    global $wpdb, $current_site, $cookiehash;
    4444
    45         if( !isset($current_site->site_name) )
    46                 $current_site->site_name = get_site_option('site_name');
     45    if( !isset($current_site->site_name) )
     46        $current_site->site_name = get_site_option('site_name');
    4747
    48         if( $current_site->site_name == false )
    49                 $current_site->site_name = ucfirst( $current_site->domain );
     48    if( $current_site->site_name == false )
     49        $current_site->site_name = ucfirst( $current_site->domain );
    5050
    51         if ( ! defined('WP_INSTALLING') ) {
    52                 // Used to guarantee unique hash cookies
    53                 if ( !isset($cookiehash) )
    54                         $cookiehash = '';
     51    if ( ! defined('WP_INSTALLING') ) {
     52        if ( !isset($cookiehash) )
     53            $cookiehash = '';
    5554
    56                 /**
    57                 * Used to guarantee unique hash cookies
    58                 * @since 1.5
    59                 */
    60                 if ( !defined('COOKIEHASH') )
    61                         define( 'COOKIEHASH', $cookiehash );
    62         }
     55        /**
     56        * Used to guarantee unique hash cookies
     57        * @since 1.5
     58        */
     59        if ( !defined('COOKIEHASH') )
     60                define( 'COOKIEHASH', $cookiehash );
     61    }
    6362
    64         $wpdb->hide_errors();
     63    $wpdb->hide_errors();
    6564}
    6665
    6766function ms_network_plugins() {
    68         $wpmu_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'wpmu_sitewide_plugins' ) );
    69         foreach( $wpmu_sitewide_plugins as $plugin_file => $activation_time ) {
    70                 if ( !$plugin_file )
    71                         continue;
     67    $network_plugins = array();
     68    $wpmu_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'wpmu_sitewide_plugins' ) );
     69    foreach( $wpmu_sitewide_plugins as $plugin_file => $activation_time ) {
     70        if ( !$plugin_file )
     71            continue;
    7272
    73                 if ( !file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) {
    74                         $deleted_sitewide_plugins[] = $plugin_file;
    75                 } else {
    76                         include_once( WP_PLUGIN_DIR . '/' . $plugin_file );
    77                 }
    78         }
     73        if ( !file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) {
     74            $deleted_sitewide_plugins[] = $plugin_file;
     75        } else {
     76            $network_plugins = WP_PLUGIN_DIR . '/' . $plugin_file;
     77        }
     78    }
    7979
    80         if ( isset( $deleted_sitewide_plugins ) ) {
    81                 $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
     80    if ( isset( $deleted_sitewide_plugins ) ) {
     81        $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
    8282
    83                 /* Remove any deleted plugins from the wpmu_sitewide_plugins array */
    84                 foreach( $deleted_sitewide_plugins as $plugin_file ) {
    85                         unset( $wpmu_sitewide_plugins[$plugin_file] );
    86                         unset( $active_sitewide_plugins[$plugin_file] );
    87                 }
     83        /* Remove any deleted plugins from the wpmu_sitewide_plugins array */
     84        foreach( $deleted_sitewide_plugins as $plugin_file ) {
     85            unset( $wpmu_sitewide_plugins[$plugin_file] );
     86            unset( $active_sitewide_plugins[$plugin_file] );
     87        }
    8888
    89                 update_site_option( 'wpmu_sitewide_plugins', $wpmu_sitewide_plugins );
    90                 update_site_option( 'active_sitewide_plugins', $wpmu_sitewide_plugins );
    91         }
     89        update_site_option( 'wpmu_sitewide_plugins', $wpmu_sitewide_plugins );
     90        update_site_option( 'active_sitewide_plugins', $wpmu_sitewide_plugins );
     91    }
    9292
     93    return $network_plugins;
    9394}
    9495
     
    100101        if ( '1' == $current_blog->deleted ) {
    101102                if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {
    102                         require_once( WP_CONTENT_DIR . '/blog-deleted.php' );
    103                         die();
     103                        return WP_CONTENT_DIR . '/blog-deleted.php';
    104104                } else {
    105105                        header('HTTP/1.1 410 Gone');
     
    110110        if ( '2' == $current_blog->deleted ) {
    111111                if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) {
    112                         require_once( WP_CONTENT_DIR . '/blog-inactive.php' );
    113                         die();
     112                        return WP_CONTENT_DIR . '/blog-inactive.php';
    114113                } else {
    115114                        graceful_fail( sprintf( __( 'This blog has not been activated yet. If you are having problems activating your blog, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
     
    119118        if( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
    120119                if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
    121                         require_once( WP_CONTENT_DIR . '/blog-suspended.php' );
    122                         die();
     120                        return WP_CONTENT_DIR . '/blog-suspended.php';
    123121                } else {
    124122                        header('HTTP/1.1 410 Gone');
     
    126124                }
    127125        }
     126        return true;
    128127}
    129128
Note: See TracChangeset for help on using the changeset viewer.