Ticket #5652: 5652.ray.patch
File 5652.ray.patch, 2.8 KB (added by , 11 years ago) |
---|
-
bp-loader.php
30 30 // Load from source if no build exists 31 31 if ( ! file_exists( $bp_loader ) || defined( 'BP_LOAD_SOURCE' ) ) { 32 32 $bp_loader = __DIR__ . '/src/bp-loader.php'; 33 $mode = 'src'; 34 } else { 35 $mode = 'build'; 36 } 37 38 // Set load mode 39 define( 'BP_LOAD_MODE', $mode ); 40 41 // Define overrides - only applicable to those running trunk 42 if ( ! defined( 'BP_PLUGIN_DIR' ) ) { 43 define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 44 } 45 if ( ! defined( 'BP_PLUGIN_URL' ) ) { 46 // Be nice to symlinked directories 47 define( 'BP_PLUGIN_URL', plugins_url( trailingslashit( basename( constant( 'BP_PLUGIN_DIR' ) ) ) ) ); 33 48 } 34 49 35 50 // Include BuddyPress -
src/bp-loader.php
227 227 228 228 // Path and URL 229 229 if ( ! defined( 'BP_PLUGIN_DIR' ) ) { 230 define( 'BP_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ )) );230 define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 231 231 } 232 232 233 233 if ( ! defined( 'BP_PLUGIN_URL' ) ) { 234 $plugin_url = plugin_dir_url( __FILE__ ); 235 236 // If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037. 237 if ( is_ssl() ) 238 $plugin_url = str_replace( 'http://', 'https://', $plugin_url ); 234 define( 'BP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 235 } 239 236 240 define( 'BP_PLUGIN_URL', $plugin_url ); 237 if ( ! defined( 'BP_LOAD_MODE' ) ) { 238 define( 'BP_LOAD_MODE', '' ); 241 239 } 242 240 243 241 // Define on which blog ID BuddyPress should run … … 260 258 $plugins = get_site_option( 'active_sitewide_plugins'); 261 259 262 260 // basename 263 $basename = plugin_basename( constant( 'BP_PLUGIN_DIR' ) . 'bp-loader.php' );261 $basename = basename( constant( 'BP_PLUGIN_DIR' ) ) . '/bp-loader.php'; 264 262 265 263 // plugin is network-activated; use main site ID instead 266 264 if ( isset( $plugins[ $basename ] ) ) { … … 358 356 /** Paths******************************************************/ 359 357 360 358 // BuddyPress root directory 361 $this->file = __FILE__;362 $this->basename = str_replace( array( 'build/', 'src/' ), '', plugin_basename( $this->file ) );363 $this->plugin_dir = BP_PLUGIN_DIR;364 $this->plugin_url = BP_PLUGIN_URL;359 $this->file = constant( 'BP_PLUGIN_DIR' ) . 'bp-loader.php'; 360 $this->basename = basename( constant( 'BP_PLUGIN_DIR' ) ) . '/bp-loader.php'; 361 $this->plugin_dir = trailingslashit( constant( 'BP_PLUGIN_DIR' ) . constant( 'BP_LOAD_MODE' ) ); 362 $this->plugin_url = trailingslashit( constant( 'BP_PLUGIN_URL' ) . constant( 'BP_LOAD_MODE' ) ); 365 363 366 364 // Languages 367 365 $this->lang_dir = $this->plugin_dir . 'bp-languages';