Skip to:
Content

BuddyPress.org

Changeset 11360


Ignore:
Timestamp:
12/29/2016 09:00:26 PM (7 years ago)
Author:
boonebgorges
Message:

Remove do_autoload checks and manual class loaders.

Our PHP 5.3 requirement means that spl_autoload_register() will
always be available.

See #7299.

Location:
trunk/src
Files:
10 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-admin.php

    r11355 r11360  
    1616// Include WP's list table class.
    1717if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
    18 
    19 if ( ! buddypress()->do_autoload ) {
    20     require dirname( __FILE__ ) . '/classes/class-bp-activity-list-table.php';
    21 }
    2218
    2319// Per_page screen option. Has to be hooked in extremely early.
  • trunk/src/bp-activity/bp-activity-akismet.php

    r11102 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-akismet.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-activity/bp-activity-loader.php

    r11064 r11360  
    1313defined( 'ABSPATH' ) || exit;
    1414
    15 if ( ! buddypress()->do_autoload ) {
    16     require dirname( __FILE__ ) . '/classes/class-bp-activity-component.php';
    17 }
    18 
    1915/**
    2016 * Set up the bp-activity component.
  • trunk/src/bp-activity/bp-activity-screens.php

    r11091 r11360  
    1414// Exit if accessed directly.
    1515defined( 'ABSPATH' ) || exit;
    16 
    17 if ( ! buddypress()->do_autoload ) {
    18     require dirname( __FILE__ ) . '/classes/class-bp-activity-theme-compat.php';
    19 }
    2016
    2117/**
  • trunk/src/bp-activity/bp-activity-template.php

    r11356 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-activity-template.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-activity/classes/class-bp-activity-component.php

    r11102 r11360  
    6464        if ( bp_is_active( 'notifications' ) ) {
    6565            $includes[] = 'notifications';
    66         }
    67 
    68         if ( ! buddypress()->do_autoload ) {
    69             $includes[] = 'classes';
    7066        }
    7167
  • trunk/src/bp-blogs/bp-blogs-loader.php

    r11064 r11360  
    1515defined( 'ABSPATH' ) || exit;
    1616
    17 if ( ! buddypress()->do_autoload ) {
    18     require dirname( __FILE__ ) . '/classes/class-bp-blogs-component.php';
    19 }
    20 
    2117/**
    2218 * Set up the bp-blogs component.
  • trunk/src/bp-blogs/bp-blogs-screens.php

    r10652 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-blogs-theme-compat.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-blogs/bp-blogs-template.php

    r11237 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-blogs-template.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-blogs/bp-blogs-widgets.php

    r10652 r11360  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-blogs-recent-posts-widget.php';
    15 }
    16 
    1713/**
    1814 * Register the widgets for the Blogs component.
  • trunk/src/bp-blogs/classes/class-bp-blogs-component.php

    r11150 r11360  
    133133        );
    134134
    135         if ( ! buddypress()->do_autoload ) {
    136             $includes[] = 'classes';
    137         }
    138 
    139135        if ( bp_is_active( 'activity' ) ) {
    140136            $includes[] = 'activity';
  • trunk/src/bp-core/bp-core-admin.php

    r11032 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-admin.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-core/bp-core-customizer-email.php

    r10899 r11360  
    4242    foreach( $settings as $setting_id => $args ) {
    4343        $wp_customize->add_setting( $setting_id, $args );
    44     }
    45 
    46     /**
    47      * BP_Customizer_Control_Range class.
    48      */
    49     if ( ! buddypress()->do_autoload ) {
    50         require_once dirname( __FILE__ ) . '/classes/class-bp-customizer-control-range.php';
    5144    }
    5245
  • trunk/src/bp-core/bp-core-loader.php

    r11064 r11360  
    1313defined( 'ABSPATH' ) || exit;
    1414
    15 if ( ! buddypress()->do_autoload ) {
    16     require dirname( __FILE__ ) . '/classes/class-bp-component.php';
    17     require dirname( __FILE__ ) . '/classes/class-bp-core.php';
    18 }
    19 
    2015/**
    2116 * Set up the bp-core component.
  • trunk/src/bp-core/bp-core-theme-compatibility.php

    r11092 r11360  
    2222 * Don't try anything you're about to witness here, at home. Ever.
    2323 */
    24 
    25 /** Base Class ****************************************************************/
    26 
    27 if ( ! buddypress()->do_autoload ) {
    28     require dirname( __FILE__ ) . '/classes/class-bp-theme-compat.php';
    29 }
    3024
    3125/** Functions *****************************************************************/
  • trunk/src/bp-core/bp-core-widgets.php

    r10652 r11360  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-core-login-widget.php';
    15 }
    16 
    1713/**
    1814 * Register bp-core widgets.
  • trunk/src/bp-core/classes/class-bp-admin.php

    r11349 r11360  
    118118     */
    119119    private function includes() {
    120         if ( ! buddypress()->do_autoload ) {
    121             require( $this->admin_dir . 'bp-core-admin-classes.php'    );
    122         }
    123 
    124120        require( $this->admin_dir . 'bp-core-admin-actions.php'    );
    125121        require( $this->admin_dir . 'bp-core-admin-settings.php'   );
  • trunk/src/bp-friends/bp-friends-loader.php

    r11064 r11360  
    1313defined( 'ABSPATH' ) || exit;
    1414
    15 if ( ! buddypress()->do_autoload ) {
    16     require dirname( __FILE__ ) . '/classes/class-bp-friends-component.php';
    17 }
    18 
    1915/**
    2016 * Set up the bp-friends component.
  • trunk/src/bp-friends/bp-friends-widgets.php

    r11008 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-core-friends-widget.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-friends/classes/class-bp-friends-component.php

    r11123 r11360  
    6060        if ( bp_is_active( 'notifications' ) ) {
    6161            $includes[] = 'notifications';
    62         }
    63 
    64         if ( ! buddypress()->do_autoload ) {
    65             $includes[] = 'classes';
    6662        }
    6763
  • trunk/src/bp-groups/bp-groups-admin.php

    r11346 r11360  
    1616// Include WP's list table class.
    1717if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
    18 
    19 if ( ! buddypress()->do_autoload ) {
    20     require dirname( __FILE__ ) . '/classes/class-bp-groups-list-table.php';
    21 }
    2218
    2319// The per_page screen option. Has to be hooked in extremely early.
  • trunk/src/bp-groups/bp-groups-loader.php

    r11064 r11360  
    1515defined( 'ABSPATH' ) || exit;
    1616
    17 if ( ! buddypress()->do_autoload ) {
    18     require dirname( __FILE__ ) . '/classes/class-bp-groups-component.php';
    19 }
    20 
    2117/**
    2218 * Set up the bp-groups component.
  • trunk/src/bp-groups/bp-groups-screens.php

    r11314 r11360  
    1414// Exit if accessed directly.
    1515defined( 'ABSPATH' ) || exit;
    16 
    17 if ( ! buddypress()->do_autoload ) {
    18     require dirname( __FILE__ ) . '/classes/class-bp-groups-theme-compat.php';
    19 }
    2016
    2117/**
  • trunk/src/bp-groups/bp-groups-template.php

    r11299 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-groups-template.php';
    15     require dirname( __FILE__ ) . '/classes/class-bp-groups-group-members-template.php';
    16     require dirname( __FILE__ ) . '/classes/class-bp-groups-membership-requests-template.php';
    17     require dirname( __FILE__ ) . '/classes/class-bp-groups-invite-template.php';
    18 }
    1912
    2013/**
  • trunk/src/bp-groups/bp-groups-widgets.php

    r11008 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-groups-widget.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-groups/classes/class-bp-groups-component.php

    r11313 r11360  
    135135            'notifications'
    136136        );
    137 
    138         if ( ! buddypress()->do_autoload ) {
    139             $includes[] = 'classes';
    140         }
    141137
    142138        if ( is_admin() ) {
  • trunk/src/bp-loader.php

    r11262 r11360  
    108108     * @var bool
    109109     */
    110     public $do_autoload = false;
     110    public $do_autoload = true;
    111111
    112112    /**
     
    465465     */
    466466    private function includes() {
    467         if ( function_exists( 'spl_autoload_register' ) ) {
    468             spl_autoload_register( array( $this, 'autoload' ) );
    469             $this->do_autoload = true;
    470         }
     467        spl_autoload_register( array( $this, 'autoload' ) );
    471468
    472469        // Load the WP abstraction file so BuddyPress can run on all WordPress setups.
     
    503500        require( $this->plugin_dir . 'bp-core/bp-core-loader.php'           );
    504501        require( $this->plugin_dir . 'bp-core/bp-core-customizer-email.php' );
    505 
    506         if ( ! $this->do_autoload ) {
    507             require( $this->plugin_dir . 'bp-core/bp-core-classes.php' );
    508         }
    509502
    510503        // Maybe load deprecated functionality (this double negative is proof positive!)
  • trunk/src/bp-members/bp-members-admin.php

    r10652 r11360  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-members-admin.php';
    15 }
    16 
    1713// Load the BP Members admin.
    1814add_action( 'bp_init', array( 'BP_Members_Admin', 'register_members_admin' ) );
  • trunk/src/bp-members/bp-members-loader.php

    r10711 r11360  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-members-component.php';
    15 }
    16 
    1713/**
    1814 * Set up the bp-members component.
  • trunk/src/bp-members/bp-members-screens.php

    r11295 r11360  
    1212// Exit if accessed directly.
    1313defined( 'ABSPATH' ) || exit;
    14 
    15 if ( ! buddypress()->do_autoload ) {
    16     require dirname( __FILE__ ) . '/classes/class-bp-members-theme-compat.php';
    17     require dirname( __FILE__ ) . '/classes/class-bp-registration-theme-compat.php';
    18 }
    1914
    2015/**
  • trunk/src/bp-members/bp-members-template.php

    r11240 r11360  
    1212// Exit if accessed directly.
    1313defined( 'ABSPATH' ) || exit;
    14 
    15 if ( ! buddypress()->do_autoload ) {
    16     require dirname( __FILE__ ) . '/classes/class-bp-core-members-template.php';
    17 }
    1814
    1915/**
  • trunk/src/bp-members/bp-members-widgets.php

    r10652 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-core-members-widget.php';
    15     require dirname( __FILE__ ) . '/classes/class-bp-core-whos-online-widget.php';
    16     require dirname( __FILE__ ) . '/classes/class-bp-core-recently-active-widget.php';
    17 }
    1812
    1913/**
  • trunk/src/bp-members/classes/class-bp-members-admin.php

    r11268 r11360  
    14321432        if ( ! empty( $required ) ) {
    14331433            require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
    1434 
    1435             if ( ! buddypress()->do_autoload ) {
    1436                 require_once( buddypress()->members->admin->admin_dir . 'bp-members-admin-classes.php' );
    1437             }
    14381434        }
    14391435
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r11080 r11360  
    6767            'cache',
    6868        );
    69 
    70         if ( ! buddypress()->do_autoload ) {
    71             $includes[] = 'classes';
    72         }
    7369
    7470        if ( bp_is_active( 'activity' ) ) {
  • trunk/src/bp-messages/bp-messages-loader.php

    r11064 r11360  
    1313defined( 'ABSPATH' ) || exit;
    1414
    15 if ( ! buddypress()->do_autoload ) {
    16     require dirname( __FILE__ ) . '/classes/class-bp-messages-component.php';
    17 }
    18 
    1915/**
    2016 * Set up the bp-messages component.
  • trunk/src/bp-messages/bp-messages-template.php

    r11292 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-messages-box-template.php';
    15     require dirname( __FILE__ ) . '/classes/class-bp-messages-thread-template.php';
    16 }
    1712
    1813/**
  • trunk/src/bp-messages/bp-messages-widgets.php

    r10652 r11360  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-messages-sitewide-notices-widget.php';
    15 }
    16 
    1713/**
    1814 * Register widgets for the Messages component.
  • trunk/src/bp-messages/classes/class-bp-messages-component.php

    r11022 r11360  
    6666            'widgets',
    6767        );
    68 
    69         if ( ! buddypress()->do_autoload ) {
    70             $includes[] = 'classes';
    71         }
    7268
    7369        // Conditional includes.
  • trunk/src/bp-notifications/bp-notifications-loader.php

    r11064 r11360  
    1313defined( 'ABSPATH' ) || exit;
    1414
    15 if ( ! buddypress()->do_autoload ) {
    16     require dirname( __FILE__ ) . '/classes/class-bp-notifications-component.php';
    17 }
    18 
    1915/**
    2016 * Set up the bp-notifications component.
  • trunk/src/bp-notifications/bp-notifications-template.php

    r10828 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-notifications-template.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-notifications/classes/class-bp-notifications-component.php

    r10788 r11360  
    5252            'cache',
    5353        );
    54 
    55         if ( ! buddypress()->do_autoload ) {
    56             $includes[] = 'classes';
    57         }
    5854
    5955        parent::includes( $includes );
  • trunk/src/bp-settings/bp-settings-loader.php

    r11064 r11360  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-settings-component.php';
    15 }
    16 
    1713/**
    1814 * Set up the bp-settings component.
  • trunk/src/bp-xprofile/bp-xprofile-admin.php

    r11345 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-xprofile-user-admin.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-xprofile/bp-xprofile-loader.php

    r11064 r11360  
    1414defined( 'ABSPATH' ) || exit;
    1515
    16 if ( ! buddypress()->do_autoload ) {
    17     require dirname( __FILE__ ) . '/classes/class-bp-xprofile-component.php';
    18 }
    19 
    2016/**
    2117 * Set up the bp-xprofile component.
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r11350 r11360  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 if ( ! buddypress()->do_autoload ) {
    14     require dirname( __FILE__ ) . '/classes/class-bp-xprofile-data-template.php';
    15 }
    1612
    1713/**
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php

    r10745 r11360  
    7878            'notifications',
    7979        );
    80 
    81         if ( ! buddypress()->do_autoload ) {
    82             $includes[] = 'classes';
    83         }
    8480
    8581        if ( is_admin() ) {
Note: See TracChangeset for help on using the changeset viewer.