<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][3994] trunk: Remove temporary bp-core-bootstrap file and move procedure into BP_Core component.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>3994</dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2011-02-02 04:35:06 +0000 (Wed, 02 Feb 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove temporary bp-core-bootstrap file and move procedure into BP_Core component. Update loaders accordingly. Also introduce optional_components and required_components global $bp values for additional future usage.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcoreadminphp">trunk/bp-core/admin/bp-core-admin.php</a></li>
<li><a href="#trunkbpcoreadminbpcoreupdatephp">trunk/bp-core/admin/bp-core-update.php</a></li>
<li><a href="#trunkbpcorebpcoreloaderphp">trunk/bp-core/bp-core-loader.php</a></li>
<li><a href="#trunkbploaderphp">trunk/bp-loader.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcorebootstrapphp">trunk/bp-core/bp-core-bootstrap.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcoreadminbpcoreadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-admin.php (3993 => 3994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-admin.php        2011-02-02 04:31:51 UTC (rev 3993)
+++ trunk/bp-core/admin/bp-core-admin.php        2011-02-02 04:35:06 UTC (rev 3994)
</span><span class="lines">@@ -99,20 +99,11 @@
</span><span class="cx">                         return false;
</span><span class="cx">
</span><span class="cx">                 // Settings form submitted, now save the settings.
</span><del>-                foreach ( (array)$_POST['bp-admin'] as $key => $value ) {
-
-                        if ( bp_is_active( 'xprofile' ) ) {
-                                if ( 'bp-xprofile-base-group-name' == $key )
-                                        $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s WHERE id = 1", stripslashes( $value ) ) );
-                                elseif ( 'bp-xprofile-fullname-field-name' == $key )
-                                        $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET name = %s WHERE group_id = 1 AND id = 1", stripslashes( $value ) ) );
-                        }
-
</del><ins>+                foreach ( (array)$_POST['bp-admin'] as $key => $value )
</ins><span class="cx">                         update_site_option( $key, $value );
</span><del>-                }
-        }
-        ?>
</del><span class="cx">
</span><ins>+        } ?>
+
</ins><span class="cx">         <div class="wrap">
</span><span class="cx">
</span><span class="cx">                 <?php screen_icon( 'buddypress' ); ?>
</span><span class="lines">@@ -212,17 +203,10 @@
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/**
- * Renders the Component Setup admin panel.
- *
- * @package BuddyPress Core
- * @since {@internal Unknown}}
- * @uses bp_core_admin_component_options()
- */
-function bp_core_admin_component_setup() {
</del><ins>+function bp_core_admin_component_setup_handler() {
</ins><span class="cx">         global $wpdb, $bp;
</span><span class="cx">
</span><del>-        if ( isset( $_POST['bp-admin-component-submit'] ) && isset( $_POST['bp_components'] ) ) {
</del><ins>+        if ( isset( $_POST['bp-admin-component-submit'] ) ) {
</ins><span class="cx">                 if ( !check_admin_referer('bp-admin-component-setup') )
</span><span class="cx">                         return false;
</span><span class="cx">
</span><span class="lines">@@ -242,15 +226,29 @@
</span><span class="cx">                         }
</span><span class="cx">                         bp_core_update_page_meta( $directory_pages );
</span><span class="cx">                 }
</span><del>-        } ?>
</del><span class="cx">
</span><ins>+                wp_redirect( admin_url( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), 'admin.php' ) ) );
+        }
+}
+add_action( 'admin_init', 'bp_core_admin_component_setup_handler' );
+
+/**
+ * Renders the Component Setup admin panel.
+ *
+ * @package BuddyPress Core
+ * @since {@internal Unknown}}
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_component_setup() {
+?>
+
</ins><span class="cx">         <div class="wrap">
</span><span class="cx">
</span><span class="cx">                 <?php screen_icon( 'buddypress'); ?>
</span><span class="cx">
</span><span class="cx">                 <h2><?php _e( 'BuddyPress Component Settings', 'buddypress' ); ?></h2>
</span><span class="cx">
</span><del>-                <?php if ( isset( $_POST['bp-admin-component-submit'] ) ) : ?>
</del><ins>+                <?php if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : ?>
</ins><span class="cx">
</span><span class="cx">                         <div id="message" class="updated fade">
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpcoreadminbpcoreupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-update.php (3993 => 3994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-update.php        2011-02-02 04:31:51 UTC (rev 3993)
+++ trunk/bp-core/admin/bp-core-update.php        2011-02-02 04:35:06 UTC (rev 3994)
</span><span class="lines">@@ -4,15 +4,15 @@
</span><span class="cx">         var $current_step;
</span><span class="cx">         var $steps;
</span><span class="cx">
</span><del>-        var $current_version;
</del><ins>+        var $database_version;
</ins><span class="cx">         var $is_network_activate;
</span><span class="cx">         var $new_version;
</span><span class="cx">         var $setup_type;
</span><span class="cx">
</span><span class="cx">         function bp_core_setup_wizard() {
</span><span class="cx">                 // Look for current DB version
</span><del>-                if ( !$this->current_version = get_site_option( 'bp-db-version' ) ) {
-                        if ( $this->current_version = get_option( 'bp-db-version' ) ) {
</del><ins>+                if ( !$this->database_version = get_site_option( 'bp-db-version' ) ) {
+                        if ( $this->database_version = get_option( 'bp-db-version' ) ) {
</ins><span class="cx">                                 $this->is_network_activate = true;
</span><span class="cx">                         } else {
</span><span class="cx">                                 setcookie( 'bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH );
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 $this->new_version = constant( 'BP_DB_VERSION' );
</span><del>-                $this->setup_type = ( empty( $this->current_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'new' : 'update';
</del><ins>+                $this->setup_type = ( empty( $this->database_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'install' : 'update';
</ins><span class="cx">                 $this->current_step = $this->current_step();
</span><span class="cx">
</span><span class="cx">                 // Call the save method that will save data and modify $current_step
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">                 // Setup wizard steps
</span><span class="cx">                 $steps = array();
</span><span class="cx">
</span><del>-                if ( 'new' == $this->setup_type ) {
</del><ins>+                if ( 'install' == $this->setup_type ) {
</ins><span class="cx">                         $steps = array(
</span><span class="cx">                                 __( 'Components', 'buddypress' ),
</span><span class="cx">                                 __( 'Pages', 'buddypress' ),
</span><span class="lines">@@ -65,10 +65,10 @@
</span><span class="cx">                         if ( $this->is_network_activate )
</span><span class="cx">                                 $steps[] = __( 'Multisite Update', 'buddypress' );
</span><span class="cx">
</span><del>-                        if ( $this->current_version < $this->new_version )
</del><ins>+                        if ( $this->database_version < $this->new_version )
</ins><span class="cx">                                 $steps[] = __( 'Database Update', 'buddypress' );
</span><span class="cx">
</span><del>-                        if ( $this->current_version < 1225 || ( function_exists( 'bp_core_get_page_meta' ) && !bp_core_get_page_meta() ) )
</del><ins>+                        if ( $this->database_version < 1225 || ( function_exists( 'bp_core_get_page_meta' ) && !bp_core_get_page_meta() ) )
</ins><span class="cx">                                 $steps[] = __( 'Pages', 'buddypress' );
</span><span class="cx">
</span><span class="cx">                         $steps[] = __( 'Finish', 'buddypress' );
</span><span class="lines">@@ -372,7 +372,7 @@
</span><span class="cx">                         $activation_slug = __( 'activate', 'buddypress' );
</span><span class="cx">
</span><span class="cx">                 // What kind of setup is taking place
</span><del>-                if ( 'new' == $this->setup_type ) : ?>
</del><ins>+                if ( 'install' == $this->setup_type ) : ?>
</ins><span class="cx">
</span><span class="cx">                         <p><?php _e( "BuddyPress needs to use pages to display content and directories.", 'buddypress' ) ?></p>
</span><span class="cx">
</span><span class="lines">@@ -690,7 +690,7 @@
</span><span class="cx">                 if ( !current_user_can( 'activate_plugins' ) )
</span><span class="cx">                         return false;
</span><span class="cx">
</span><del>-                if ( 'new' == $this->setup_type ) :
</del><ins>+                if ( 'install' == $this->setup_type ) :
</ins><span class="cx">                         $type = __( 'setup', 'buddypress' ); ?>
</span><span class="cx">
</span><span class="cx">                         <h2>Setup Complete!</h2>
</span><span class="lines">@@ -729,7 +729,7 @@
</span><span class="cx">                         // Run the schema install to update tables
</span><span class="cx">                         bp_core_install();
</span><span class="cx">
</span><del>-                        if ( $this->current_version < 1225 )
</del><ins>+                        if ( $this->database_version < 1225 )
</ins><span class="cx">                                 $this->update_1_3();
</span><span class="cx">                                 
</span><span class="cx">                         return true;
</span><span class="lines">@@ -749,7 +749,7 @@
</span><span class="cx">
</span><span class="cx">                         // Transfer important settings from blog options to site options
</span><span class="cx">                         $options = array(
</span><del>-                                'bp-db-version' => $this->current_version,
</del><ins>+                                'bp-db-version' => $this->database_version,
</ins><span class="cx">                                 'bp-deactivated-components' => $disabled,
</span><span class="cx">                                 'avatar-default' => get_option( 'avatar-default' )
</span><span class="cx">                         );
</span><span class="lines">@@ -1120,13 +1120,13 @@
</span><span class="cx">         global $menu, $admin_page_hooks, $_registered_pages;
</span><span class="cx">
</span><span class="cx">         $defaults = array(
</span><del>-                'page_title' => '',
-                'menu_title' => '',
-                'capability' => 'manage_options',
-                'menu_slug' => '',
-                'function' => false,
-                'icon_url' => false,
-                'position' => 100
</del><ins>+                'page_title' => '',
+                'menu_title' => '',
+                'capability' => 'manage_options',
+                'menu_slug' => '',
+                'function' => false,
+                'icon_url' => false,
+                'position' => 100
</ins><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="lines">@@ -1187,7 +1187,7 @@
</span><span class="cx">         global $bp_wizard;
</span><span class="cx">
</span><span class="cx">         // Only load this version of the menu if this is an upgrade or a new installation
</span><del>-        if ( ( !defined( 'BP_IS_UPGRADE' ) || !BP_IS_UPGRADE ) && ( !defined( 'BP_IS_INSTALL' ) || !BP_IS_INSTALL ) )
</del><ins>+        if ( ( empty( $bp->maintenence_mode ) ) )
</ins><span class="cx">                 return false;
</span><span class="cx">         
</span><span class="cx">         if ( !current_user_can( 'activate_plugins' ) )
</span><span class="lines">@@ -1200,12 +1200,12 @@
</span><span class="cx">
</span><span class="cx">         // Add the administration tab under the "Site Admin" tab for site administrators
</span><span class="cx">         bp_core_update_add_admin_menu_page( array(
</span><del>-                'menu_title' => __( 'BuddyPress', 'buddypress' ),
-                'page_title' => __( 'BuddyPress', 'buddypress' ),
-                'capability' => 'manage_options',
-                'menu_slug' => 'bp-wizard',
-                'function' => '',
-                'position' => 3
</del><ins>+                'menu_title' => __( 'BuddyPress', 'buddypress' ),
+                'page_title' => __( 'BuddyPress', 'buddypress' ),
+                'capability' => 'manage_options',
+                'menu_slug' => 'bp-wizard',
+                'function' => '',
+                'position' => 3
</ins><span class="cx">         ) );
</span><span class="cx">
</span><span class="cx">         $hook = add_submenu_page( 'bp-wizard', $status, $status, 'manage_options', 'bp-wizard', array( $bp_wizard, 'html' ) );
</span><span class="lines">@@ -1263,30 +1263,33 @@
</span><span class="cx">         return $page_ids;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/**
- * Adds an admin nag about running the BP upgrade/install wizard
- *
- * @package BuddyPress Core
- * @since 1.3
- * @global $pagenow The current admin page
- */
-function bp_core_update_nag() {
-        global $pagenow;
</del><ins>+/**
+ * Adds an admin nag about running the BP upgrade/install wizard
+ *
+ * @package BuddyPress Core
+ * @since 1.3
+ * @global $pagenow The current admin page
+ */
+function bp_core_update_nag() {
+        global $pagenow;
</ins><span class="cx">
</span><del>-         if ( !is_super_admin() )
-                 return;
-         
-         if ( 'admin.php' == $pagenow && ( empty( $_GET['page'] ) || 'bp-wizard' == $_GET['page'] ) )
-                 return;
-         
-         if ( defined( 'BP_IS_UPGRADE' ) && BP_IS_UPGRADE )
-                 $msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">upgrade wizard</a>.', 'buddypress' ), admin_url( 'admin.php?page=bp-wizard' ) );
-         else if ( defined( 'BP_IS_INSTALL' ) && BP_IS_INSTALL )
-                 $msg = sprintf( __( 'BuddyPress has been installed! Please run the <a href="%s">upgrade wizard</a>.', 'buddypress' ), admin_url( 'admin.php?page=bp-wizard' ) );
-
-         echo "<div class='update-nag'>$msg</div>";
-}
</del><ins>+        if ( !is_super_admin() )
+                return;
+        
+        if ( 'admin.php' == $pagenow && ( empty( $_GET['page'] ) || 'bp-wizard' == $_GET['page'] ) )
+                return;
+
+        switch( $bp->maintenence_mode ) {
+                case 'update' :
+                        $msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), admin_url( 'admin.php?page=bp-wizard' ) );
+                        break;
+                case 'install' :
+                        $msg = sprintf( __( 'BuddyPress was successfully installed! Please run the <a href="%s">installation wizard</a>.', 'buddypress' ), admin_url( 'admin.php?page=bp-wizard' ) );
+                        break;
+        }
+
+        echo '<div class="update-nag">' . $msg . '</div>';
+}
</ins><span class="cx"> add_action( 'admin_notices', 'bp_core_update_nag', 5 );
</span><span class="cx">
</span><del>-
</del><span class="cx"> ?>
</span></span></pre></div>
<a id="trunkbpcorebpcorebootstrapphp"></a>
<div class="delfile"><h4>Deleted: trunk/bp-core/bp-core-bootstrap.php (3993 => 3994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-bootstrap.php        2011-02-02 04:31:51 UTC (rev 3993)
+++ trunk/bp-core/bp-core-bootstrap.php        2011-02-02 04:35:06 UTC (rev 3994)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-<?php
-
-// Setup the BuddyPress theme directory
-register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
-
-// Test to see whether this is a new installation or an upgraded version of BuddyPress
-if ( !$bp_db_version = get_site_option( 'bp-db-version' ) )
-        $bp_db_version = get_site_option( 'bp-core-db-version' ); // BP 1.2 option name
-
-// This is a new installation. Run the wizard before loading BP core files
-if ( empty( $bp_db_version ) ) {
-         define( 'BP_IS_INSTALL', true );
-        require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
-
-// Existing successful installation
-} else {
-
-        // Always require the BuddyPress Core - It cannot be turned off
-        require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
-
-        /**
-         * At this point in the stack, BuddyPress core has been loaded but
-         * individual components (friends/activity/groups/etc...) have not.
-         *
-         * The 'bp_core_loaded' action lets you execute code ahead of the
-         * other components.
-         */
-        do_action( 'bp_core_loaded' );
-
-        // Get a list of deactivated components
-        $bp->active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) );
-
-        // Activity Streams
-        if ( bp_is_active( 'activity') && file_exists( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php' );
-
-        // Blog Tracking
-        if ( bp_is_active( 'blogs') && file_exists( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php' );
-
-        // bbPress Forum Integration
-        if ( bp_is_active( 'forums') && file_exists( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php' );
-
-        // Friend Connections
-        if ( bp_is_active( 'friends') && file_exists( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php' );
-
-        // Groups Support
-        if ( bp_is_active( 'groups') && file_exists( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php' );
-
-        // Private Messaging
-        if ( bp_is_active( 'messages') && file_exists( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php' );
-
-        // Extended Profiles
-        if ( bp_is_active( 'xprofile') && file_exists( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php' );
-
-        // Member Settings
-        if ( bp_is_active( 'settings') && file_exists( BP_PLUGIN_DIR . '/bp-settings/bp-settings-loader.php') )
-                include( BP_PLUGIN_DIR . '/bp-settings/bp-settings-loader.php' );
-
-        // Always require BuddyPress Members - It cannot be turned off (yet)
-        include( BP_PLUGIN_DIR . '/bp-members/bp-members-loader.php' );
-
-        // If this is an upgrade, load the upgrade file
-        if ( $bp_db_version < constant( 'BP_DB_VERSION' ) ) {
-                define( 'BP_IS_UPGRADE', true );
-                require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
-        }
-}
-
-?>
</del></span></pre></div>
<a id="trunkbpcorebpcoreloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-loader.php (3993 => 3994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-loader.php        2011-02-02 04:31:51 UTC (rev 3993)
+++ trunk/bp-core/bp-core-loader.php        2011-02-02 04:35:06 UTC (rev 3994)
</span><span class="lines">@@ -1,21 +1,21 @@
</span><span class="cx"> <?php
</span><span class="cx">
</span><span class="cx"> // Require all of the BuddyPress core libraries
</span><del>-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-cache.php' );
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-hooks.php' );
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-cssjs.php' );
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-classes.php' );
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-filters.php' );
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-avatars.php' );
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-widgets.php' );
</del><ins>+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-cache.php' );
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-hooks.php' );
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-cssjs.php' );
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-classes.php' );
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-filters.php' );
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-avatars.php' );
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-widgets.php' );
</ins><span class="cx"> require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-template.php' );
</span><span class="cx"> require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-buddybar.php' );
</span><span class="cx"> require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-catchuri.php' );
</span><del>-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-component.php' );
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
</del><ins>+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-component.php' );
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
</ins><span class="cx">
</span><span class="cx"> // Load deprecated functions
</span><del>-if ( !defined( 'BP_SKIP_DEPRECATED' ) )
</del><ins>+if ( !empty( $bp->load_deprecated ) )
</ins><span class="cx">         require_once( BP_PLUGIN_DIR . '/bp-core/deprecated/1.3.php' );
</span><span class="cx">
</span><span class="cx"> // Load the WP admin bar.
</span><span class="lines">@@ -32,8 +32,47 @@
</span><span class="cx">                         __( 'BuddyPress Core', 'buddypress' )
</span><span class="cx">                         , BP_PLUGIN_DIR
</span><span class="cx">                 );
</span><ins>+
+                $this->_bootstrap();
</ins><span class="cx">         }
</span><span class="cx">
</span><ins>+        function _bootstrap() {
+                global $bp;
+
+                /**
+                 * At this point in the stack, BuddyPress core has been loaded but
+                 * individual components (friends/activity/groups/etc...) have not.
+                 *
+                 * The 'bp_core_loaded' action lets you execute code ahead of the
+                 * other components.
+                 */
+                do_action( 'bp_core_loaded' );
+
+                /** Components ********************************************************/
+
+                // Get a list of activated components
+                $bp->active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) );
+
+                // Set the included and optional components
+                $bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile', ) );
+
+                // Set the required components
+                $bp->required_components = apply_filters( 'bp_required_components', array( 'members', ) );
+
+                // Loop through optional components
+                foreach( $bp->optional_components as $component )
+                        if ( bp_is_active( $component) && file_exists( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) )
+                                include( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' );
+
+                // Loop through required components
+                foreach( $bp->required_components as $component )
+                        if ( file_exists( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) )
+                                include( BP_PLUGIN_DIR . '/bp-members/bp-members-loader.php' );
+
+                // Add Core to required components
+                $bp->required_components[] = 'core';
+        }
+
</ins><span class="cx">         function _setup_globals() {
</span><span class="cx">                 global $bp;
</span><span class="cx">
</span><span class="lines">@@ -129,6 +168,8 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><ins>+
+// Initialize the BuddyPress Core
</ins><span class="cx"> $bp->core = new BP_Core();
</span><span class="cx">
</span><span class="cx"> ?>
</span></span></pre></div>
<a id="trunkbploaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-loader.php (3993 => 3994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-loader.php        2011-02-02 04:31:51 UTC (rev 3993)
+++ trunk/bp-loader.php        2011-02-02 04:35:06 UTC (rev 3994)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx"> * Author URI: http://buddypress.org/community/members/
</span><span class="cx"> * Network: true
</span><span class="cx"> */
</span><ins>+
</ins><span class="cx"> /** Constants *****************************************************************/
</span><span class="cx">
</span><span class="cx"> // Define the BuddyPress version
</span><span class="lines">@@ -18,6 +19,11 @@
</span><span class="cx"> if ( !defined( 'BP_DB_VERSION' ) )
</span><span class="cx">         define( 'BP_DB_VERSION', 3605 );
</span><span class="cx">
</span><ins>+// Place your custom code (actions/filters) in a file called
+// '/plugins/bp-custom.php' and it will be loaded before anything else.
+if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
+        require_once( WP_PLUGIN_DIR . '/bp-custom.php' );
+
</ins><span class="cx"> // Define on which blog ID BuddyPress should run
</span><span class="cx"> if ( !defined( 'BP_ROOT_BLOG' ) )
</span><span class="cx">         define( 'BP_ROOT_BLOG', 1 );
</span><span class="lines">@@ -29,14 +35,6 @@
</span><span class="cx"> if ( !defined( 'BP_PLUGIN_URL' ) )
</span><span class="cx">         define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
</span><span class="cx">
</span><del>-// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
-
-// Place your custom code (actions/filters) in a file called
-// '/plugins/bp-custom.php' and it will be loaded before anything else.
-if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
-        require_once( WP_PLUGIN_DIR . '/bp-custom.php' );
-
</del><span class="cx"> // Define the user and usermeta table names, useful if you are using custom or shared tables.
</span><span class="cx"> if ( !defined( 'CUSTOM_USER_TABLE' ) )
</span><span class="cx">         define( 'CUSTOM_USER_TABLE', $wpdb->base_prefix . 'users' );
</span><span class="lines">@@ -48,10 +46,35 @@
</span><span class="cx"> if ( !defined( 'BP_SEARCH_SLUG' ) )
</span><span class="cx">         define( 'BP_SEARCH_SLUG', 'search' );
</span><span class="cx">
</span><ins>+// Setup the BuddyPress theme directory
+register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
+
</ins><span class="cx"> /** Loader ********************************************************************/
</span><span class="cx">
</span><del>-require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-bootstrap.php' );
</del><ins>+// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
+require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
</ins><span class="cx">
</span><ins>+// Test to see whether this is a new installation or an upgraded version of BuddyPress
+if ( !$bp->database_version = get_site_option( 'bp-db-version' ) )
+        $bp->database_version = get_site_option( 'bp-core-db-version' ); // BP 1.2 option name
+
+// This is a new installation.
+if ( empty( $bp->database_version ) ) {
+         $bp->maintenence_mode = 'install';
+        require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
+
+// An update is required
+} elseif ( $bp->database_version < constant( 'BP_DB_VERSION' ) ) {
+        $bp->maintenence_mode = 'update';
+        require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
+
+// Existing installation - No maintenence required
+} else {
+        require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
+}
+
+/** Activation ****************************************************************/
+
</ins><span class="cx"> if ( !function_exists( 'bp_loader_activate' ) ) :
</span><span class="cx"> /**
</span><span class="cx"> * Defines BP's activation routine.
</span></span></pre>
</div>
</div>
</body>
</html>