本文整理汇总了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
}