Changeset 995 for branches/0.8/bb-settings.php
- Timestamp:
- 01/03/08 00:57:27 (1 year ago)
- Files:
-
- branches/0.8/bb-settings.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.8/bb-settings.php
r840 r995 4 4 die(sprintf('Your server is running PHP version %s but bbPress requires at least 4.2', phpversion()) ); 5 5 6 if ( !extension_loaded('mysql') && !extension_loaded('mysqli') )7 die('Your PHP installation appears to be missing the MySQL which is required for bbPress.');8 9 6 if ( !$bb_table_prefix ) 10 7 die('You must specify a table prefix in your <code>config.php</code> file.'); 11 12 if ( preg_match('/[^A-Za-z0-9_]/', $bb_table_prefix) )13 die('Your table prefix may only contain letters, numbers and underscores.');14 8 15 9 if ( !defined('BBPATH') ) … … 87 81 if ( !defined('BBTHEMEURL') ) 88 82 define('BBTHEMEURL', $bb->uri . 'my-templates/'); 89 90 if ( extension_loaded('mysqli') ) { 83 if ( !defined('BBDEFAULTTHEMEDIR') ) 84 define('BBDEFAULTTHEMEDIR', BBPATH . 'bb-templates/kakumei/'); 85 if ( !defined('BBDEFAULTTHEMEURL') ) 86 define('BBDEFAULTTHEMEURL', $bb->uri . 'bb-templates/kakumei/'); 87 88 require( BBPATH . BBINC . 'db-base.php'); 89 if ( extension_loaded('mysql') ) { 90 require( BBPATH . BBINC . 'db.php'); 91 } elseif ( extension_loaded('mysqli') ) { 91 92 require( BBPATH . BBINC . 'db-mysqli.php'); 92 93 } else { 93 require( BBPATH . BBINC . 'db.php');94 } 95 96 $bbdb->forums = $bb_table_prefix . 'forums';97 $bbdb->posts = $bb_table_prefix . 'posts';98 $bbdb->topics = $bb_table_prefix . 'topics';99 $bbdb->topicmeta = $bb_table_prefix . 'topicmeta';100 $bbdb->users = ( $bb->wp_table_prefix ? $bb->wp_table_prefix : $bb_table_prefix ) . 'users';101 $bbdb->usermeta = ( $bb->wp_table_prefix ? $bb->wp_table_prefix : $bb_table_prefix ) . 'usermeta'; 102 $bbdb->tags = $bb_table_prefix . 'tags'; 103 $bbdb->tagged = $bb_table_prefix . 'tagged';94 die('Your PHP installation appears to be missing the MySQL which is required for bbPress.'); 95 } 96 97 require( BBPATH . BBINC . 'compat.php'); 98 require( BBPATH . BBINC . 'wp-functions.php'); 99 require( BBPATH . BBINC . 'functions.php'); 100 require( BBPATH . BBINC . 'wp-classes.php'); 101 require( BBPATH . BBINC . 'classes.php'); 102 103 if ( is_wp_error( $bbdb->set_prefix( $bb_table_prefix ) ) ) 104 die('Your table prefix may only contain letters, numbers and underscores.'); 104 105 105 106 foreach ( array('use_cache', 'secret', 'debug', 'wp_table_prefix', 'wp_home', 'wp_siteurl', 'cookiedomain', 'static_title', 'load_options', 'akismet_key') as $o ) … … 113 114 unset($i); 114 115 115 require( BBPATH . BBINC . 'functions.php');116 require( BBPATH . BBINC . 'wp-classes.php');117 require( BBPATH . BBINC . 'classes.php');118 116 require( BBPATH . BBINC . 'formatting-functions.php'); 119 117 require( BBPATH . BBINC . 'template-functions.php'); … … 121 119 require( BBPATH . BBINC . 'cache.php'); 122 120 require( BBPATH . BBINC . 'deprecated.php'); 123 require( BBPATH . BBINC . 'wp-functions.php');124 121 if ( defined('BBLANG') && '' != constant('BBLANG') ) { 125 122 include_once(BBPATH . BBINC . 'streams.php'); … … 134 131 require( BBPATH . BBINC . 'default-filters.php'); 135 132 require( BBPATH . BBINC . 'script-loader.php'); 136 require( BBPATH . BBINC . 'compat.php');137 133 138 134 if ( !bb_is_installed() && false === strpos($_SERVER['PHP_SELF'], 'install.php') && !defined('BB_INSTALLING') ) … … 141 137 $bb_cache = new BB_Cache(); 142 138 143 if ( $bb->load_options ) 139 if ( $bb->load_options ) { 140 $bbdb->hide_errors(); 144 141 bb_cache_all_options(); 142 $bbdb->show_errors(); 143 } 145 144 146 145 $_GET = bb_global_sanitize($_GET ); … … 148 147 $_COOKIE = bb_global_sanitize($_COOKIE, false); 149 148 $_SERVER = bb_global_sanitize($_SERVER); 150 151 new BB_Dir_Map( BBPLUGINDIR, array( 'recurse' => 0, 'callback' => create_function( '$f,$_f', 'if ( preg_match("/^_.*?\.php$/", $_f) ) require($f);' ) ) );152 do_action( 'bb_underscore_plugins_loaded' );153 154 if ( $plugins = bb_get_option( 'active_plugins' ) )155 foreach ( (array) $plugins as $plugin )156 if ( file_exists(BBPLUGINDIR . $plugin) )157 require( BBPLUGINDIR . $plugin );158 do_action( 'bb_plugins_loaded' );159 unset($plugins, $plugin);160 161 require( BBPATH . BBINC . 'pluggable.php');162 149 163 150 if ( defined('CUSTOM_USER_TABLE') ) … … 179 166 $bb->tagpath = $bb->path; 180 167 168 if ( is_callable( 'glob' ) ) 169 foreach ( glob(BBPLUGINDIR . '_*.php') as $_plugin ) 170 require($_plugin); 171 unset($_plugin); 172 do_action( 'bb_underscore_plugins_loaded' ); 173 174 if ( $plugins = bb_get_option( 'active_plugins' ) ) 175 foreach ( (array) $plugins as $plugin ) 176 if ( file_exists(BBPLUGINDIR . $plugin) ) 177 require( BBPLUGINDIR . $plugin ); 178 do_action( 'bb_plugins_loaded' ); 179 unset($plugins, $plugin); 180 181 require( BBPATH . BBINC . 'pluggable.php'); 182 181 183 // Load the default text localization domain. 182 184 load_default_textdomain();