本文整理匯總了PHP中Piwik\DbHelper::deleteArchiveTables方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbHelper::deleteArchiveTables方法的具體用法?PHP DbHelper::deleteArchiveTables怎麽用?PHP DbHelper::deleteArchiveTables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\DbHelper
的用法示例。
在下文中一共展示了DbHelper::deleteArchiveTables方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteArchiveTables
/**
* Drops all archive tables.
*/
public static function deleteArchiveTables()
{
DbHelper::deleteArchiveTables();
}
示例2: onEnvironmentBootstrapped
public function onEnvironmentBootstrapped()
{
if (empty($_GET['ignoreClearAllViewDataTableParameters'])) {
// TODO: should use testingEnvironment variable, not query param
try {
\Piwik\ViewDataTable\Manager::clearAllViewDataTableParameters();
} catch (\Exception $ex) {
// ignore (in case DB is not setup)
}
}
if ($this->vars->optionsOverride) {
try {
foreach ($this->vars->optionsOverride as $name => $value) {
Option::set($name, $value);
}
} catch (\Exception $ex) {
// ignore (in case DB is not setup)
}
}
\Piwik\Plugins\CoreVisualizations\Visualizations\Cloud::$debugDisableShuffle = true;
\Piwik\Visualization\Sparkline::$enableSparklineImages = false;
\Piwik\Plugins\ExampleUI\API::$disableRandomness = true;
if ($this->vars->deleteArchiveTables && !$this->vars->_archivingTablesDeleted) {
$this->vars->_archivingTablesDeleted = true;
DbHelper::deleteArchiveTables();
}
}
示例3: testPurgeDataDeleteLogsNoData
/**
* Test that purgeData works when there's no data.
*/
public function testPurgeDataDeleteLogsNoData()
{
DbHelper::truncateAllTables();
DbHelper::deleteArchiveTables();
// get purge data prediction
$prediction = PrivacyManager::getPurgeEstimate();
// perform checks on prediction
$expectedPrediction = array();
$this->assertEquals($expectedPrediction, $prediction);
// purge data
$this->_setTimeToRun();
$this->assertTrue($this->instance->deleteLogData());
$this->assertTrue($this->instance->deleteReportData());
// perform checks
$this->assertEquals(0, $this->_getTableCount('log_visit'));
$this->assertEquals(0, $this->_getTableCount('log_conversion'));
$this->assertEquals(0, $this->_getTableCount('log_link_visit_action'));
$this->assertEquals(0, $this->_getTableCount('log_conversion_item'));
$archiveTables = self::_getArchiveTableNames();
$this->assertFalse($this->_tableExists($archiveTables['numeric'][0]));
// January
$this->assertFalse($this->_tableExists($archiveTables['numeric'][1]));
// February
$this->assertFalse($this->_tableExists($archiveTables['blob'][0]));
// January
$this->assertFalse($this->_tableExists($archiveTables['blob'][1]));
// February
}