if ( $wgSharedDB && in_array( $tbl, $wgSharedTables, true ) ) {
// Shared tables don't work properly when cloning due to
// how prefixes are handled (bug 65654)
- throw new MWException( "Cannot clone shared table $tbl." );
+ throw new RuntimeException( "Cannot clone shared table $tbl." );
}
# Clean up from previous aborted run. So that table escaping
# works correctly across DB engines, we need to change the pre-
) {
if ( $oldTableName === $newTableName ) {
// Last ditch check to avoid data loss
- throw new MWException( "Not dropping new table, as '$newTableName'"
+ throw new LogicException( "Not dropping new table, as '$newTableName'"
. " is name of both the old and the new table." );
}
$this->db->dropTable( $tbl, __METHOD__ );
*/
public static function changePrefix( $prefix ) {
global $wgDBprefix;
- wfGetLBFactory()->forEachLB( function( $lb ) use ( $prefix ) {
- $lb->forEachOpenConnection( function ( $db ) use ( $prefix ) {
+ wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( $prefix ) {
+ $lb->setDomainPrefix( $prefix );
+ $lb->forEachOpenConnection( function ( DatabaseBase $db ) use ( $prefix ) {
$db->tablePrefix( $prefix );
} );
} );