/** * @param integer $version * @param string|null $namespace */ public function runUpdate($version, $namespace = null) { $versionBumps = CM_App::getInstance()->runUpdateScript($namespace, $version); if ($versionBumps > 0) { $db = CM_Db_Db::getClient()->getDatabaseName(); CM_Db_Db::exec('DROP DATABASE IF EXISTS `' . $db . '_test`'); } }
public static function setUpBeforeClass() { self::$_client = CM_Db_Db::getClient(); CM_Db_Db::exec('CREATE TABLE `test` (`id` INT(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`))'); }
public static function setUpBeforeClass() { self::$_client = CM_Db_Db::getClient(); }
/** * @param CM_Splittest_Fixture $fixture * @param bool|null $updateCache * @return array */ protected function _getVariationListFixture(CM_Splittest_Fixture $fixture, $updateCache = null) { $columnId = $fixture->getColumnId(); $columnIdQuoted = CM_Db_Db::getClient()->quoteIdentifier($columnId); $fixtureId = $fixture->getId(); $updateCache = (bool) $updateCache; $cacheKey = self::_getCacheKeyFixture($fixture); $cache = CM_Cache_Local::getInstance(); if ($updateCache || ($variationListFixture = $cache->get($cacheKey)) === false) { $variationListFixture = CM_Db_Db::exec(' SELECT `variation`.`splittestId`, `variation`.`name` AS `variation`, `splittest`.`createStamp` AS `flushStamp` FROM `cm_splittestVariation_fixture` `fixture` JOIN `cm_splittestVariation` `variation` ON(`variation`.`id` = `fixture`.`variationId`) JOIN `cm_splittest` `splittest` ON(`splittest`.`id` = `fixture`.`splittestId`) WHERE `fixture`.' . $columnIdQuoted . ' = ?', array($fixtureId))->fetchAllTree(); $cache->set($cacheKey, $variationListFixture); } return $variationListFixture; }