本文整理汇总了PHP中CM_Db_Db::getClient方法的典型用法代码示例。如果您正苦于以下问题:PHP CM_Db_Db::getClient方法的具体用法?PHP CM_Db_Db::getClient怎么用?PHP CM_Db_Db::getClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CM_Db_Db
的用法示例。
在下文中一共展示了CM_Db_Db::getClient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runUpdate
/**
* @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`');
}
}
示例2: setUpBeforeClass
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`))');
}
示例3: setUpBeforeClass
public static function setUpBeforeClass()
{
self::$_client = CM_Db_Db::getClient();
}
示例4: _getVariationListFixture
/**
* @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;
}