BUG New capture method wouldnt carry test db name through to clone in tests

This commit is contained in:
Hamish Friedlander 2012-07-19 14:14:12 +12:00
parent b2152b4c5e
commit f4fd71665a
1 changed files with 6 additions and 4 deletions

View File

@ -46,8 +46,8 @@ class SearchUpdater extends Object {
static function bind_manipulation_capture() {
global $databaseConfig;
$connector = DB::getConn();
if (!$connector || @$connector->isManipulationCapture) return; // If not yet set, or its already captured, just return
$current = DB::getConn();
if (!$current || @$current->isManipulationCapture) return; // If not yet set, or its already captured, just return
$type = $databaseConfig['type'];
$file = TEMP_FOLDER."/.cache.SMC.$type";
@ -69,8 +69,10 @@ class SearchUpdater extends Object {
require_once($file);
$dbClass = 'SearchManipulateCapture_'.$type;
$conn = new $dbClass($databaseConfig);
DB::setConn($conn);
$captured = new $dbClass($databaseConfig);
// The connection might have had it's name changed (like if we're currently in a test)
$captured->selectDatabase($current->currentDatabase());
DB::setConn($captured);
}
static $dirty = array(); static $dirtycount = 0;