示例#1
0
/**
 * Main installer
 *
 * Can be passed an optional array of components to explicitly run installation
 * routines on, typically the first time a component is activated in Settings.
 *
 * @since BuddyPress (1.0.0)
 *
 * @param array $active_components Components to install
 */
function bp_core_install($active_components = false)
{
    // If no components passed, get all the active components from the main site
    if (empty($active_components)) {
        $active_components = apply_filters('bp_active_components', bp_get_option('bp-active-components'));
    }
    // Install Activity Streams even when inactive (to store last_activity data)
    bp_core_install_activity_streams();
    // Install the signups table
    bp_core_maybe_install_signups();
    // Notifications
    if (!empty($active_components['notifications'])) {
        bp_core_install_notifications();
    }
    // Friend Connections
    if (!empty($active_components['friends'])) {
        bp_core_install_friends();
    }
    // Extensible Groups
    if (!empty($active_components['groups'])) {
        bp_core_install_groups();
    }
    // Private Messaging
    if (!empty($active_components['messages'])) {
        bp_core_install_private_messaging();
    }
    // Extended Profiles
    if (!empty($active_components['xprofile'])) {
        bp_core_install_extended_profiles();
    }
    // Blog tracking
    if (!empty($active_components['blogs'])) {
        bp_core_install_blog_tracking();
    }
}
示例#2
0
/**
 * 2.0.1 database upgrade routine.
 *
 * @since 2.0.1
 *
 * @return void
 */
function bp_update_to_2_0_1()
{
    // We purposely call this during both the 2.0 upgrade and the 2.0.1 upgrade.
    // Don't worry; it won't break anything, and safely handles all cases.
    bp_core_maybe_install_signups();
}