Changeset 3350 for branches/1.2/bp-forums/bp-forums-bbpress.php
- Timestamp:
- 11/04/2010 11:05:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-forums/bp-forums-bbpress.php
r3258 r3350 1 1 <?php 2 3 2 function bp_forums_load_bbpress() { 4 3 global $bp, $wpdb, $wp_roles, $current_user, $wp_users_object; … … 140 139 */ 141 140 class BPDB extends WPDB { 141 var $db_servers = array(); 142 143 function BPDB( $dbuser, $dbpassword, $dbname, $dbhost ) { 144 parent::WPDB( $dbuser, $dbpassword, $dbname, $dbhost ); 145 146 $args = func_get_args(); 147 $args = call_user_func_array( array( &$this, '_init' ), $args ); 148 149 if ( $args['host'] ) 150 $this->db_servers['dbh_global'] = $args; 151 } 152 153 /** 154 * Determine if a database supports a particular feature. 155 * 156 * Overriden here to work around differences between bbPress', and WordPress', implementation differences. 157 * In particular, when BuddyPress tries to run bbPress' SQL installation script, the collation check always 158 * failed. The capability is long supported by WordPress' minimum required MySQL version, so this is safe. 159 */ 160 function has_cap( $db_cap, $_table_name='' ) { 161 if ( 'collation' == $db_cap ) 162 return true; 163 164 return parent::has_cap( $db_cap ); 165 } 166 167 /** 168 * Initialises the class variables based on provided arguments. 169 * Based on, and taken from, the BackPress class in turn taken from the 1.0 branch of bbPress. 170 */ 171 function _init( $args ) 172 { 173 if ( 4 == func_num_args() ) { 174 $args = array( 175 'user' => $args, 176 'password' => func_get_arg( 1 ), 177 'name' => func_get_arg( 2 ), 178 'host' => func_get_arg( 3 ), 179 'charset' => defined( 'BBDB_CHARSET' ) ? BBDB_CHARSET : false, 180 'collate' => defined( 'BBDB_COLLATE' ) ? BBDB_COLLATE : false, 181 ); 182 } 183 184 $defaults = array( 185 'user' => false, 186 'password' => false, 187 'name' => false, 188 'host' => 'localhost', 189 'charset' => false, 190 'collate' => false, 191 'errors' => false 192 ); 193 194 return wp_parse_args( $args, $defaults ); 195 } 196 142 197 function escape_deep( $data ) { 143 198 if ( is_array( $data ) ) { … … 170 225 } 171 226 } 172 173 174 175 227 ?>
Note: See TracChangeset
for help on using the changeset viewer.