本文整理汇总了PHP中Piwik\Db::dropTables方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::dropTables方法的具体用法?PHP Db::dropTables怎么用?PHP Db::dropTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Db
的用法示例。
在下文中一共展示了Db::dropTables方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
// clean up your test here if needed
$tables = ArchiveTableCreator::getTablesArchivesInstalled();
if (!empty($tables)) {
Db::dropTables($tables);
}
parent::tearDown();
}
示例2: uninstall
public static function uninstall()
{
Db::dropTables(array(Common::prefixTable('alert'), Common::prefixTable('alert_triggered'), Common::prefixTable('alert_site')));
}
示例3: uninstall
public static function uninstall()
{
Db::dropTables(Common::prefixTable(self::$rawPrefix));
}
示例4: uninstall
/**
* @throws Exception if non-recoverable error
*/
public function uninstall()
{
Db::dropTables(Common::prefixTable('user_language'));
}
示例5: purgeData
/**
* Purges old report/metric data.
*
* If $keepBasicMetrics is false, old numeric tables will be dropped, otherwise only
* the metrics not in $metricsToKeep will be deleted.
*
* If $reportPeriodsToKeep is an empty array, old blob tables will be dropped. Otherwise,
* specific reports will be deleted, except reports for periods in $reportPeriodsToKeep.
*
* @param bool $optimize If tables should be optimized after rows are deleted. Normally,
* this is handled by a scheduled task.
*/
public function purgeData($optimize = false)
{
// find archive tables to purge
list($oldNumericTables, $oldBlobTables) = $this->getArchiveTablesToPurge();
// process blob tables first, since archive status is stored in the numeric archives
if (!empty($oldBlobTables)) {
// if no reports should be kept, drop tables, otherwise drop individual reports
if (empty($this->reportPeriodsToKeep) && !$this->keepSegmentReports) {
Db::dropTables($oldBlobTables);
} else {
foreach ($oldBlobTables as $table) {
$where = $this->getBlobTableWhereExpr($oldNumericTables, $table);
if (!empty($where)) {
$where = "WHERE {$where}";
}
Db::deleteAllRows($table, $where, "idarchive ASC", $this->maxRowsToDeletePerQuery);
}
if ($optimize) {
Db::optimizeTables($oldBlobTables);
}
}
}
// deal with numeric tables
if (!empty($oldNumericTables)) {
// if keep_basic_metrics is set, empty all numeric tables of metrics to purge
if ($this->keepBasicMetrics == 1 && !empty($this->metricsToKeep)) {
$where = "WHERE name NOT IN ('" . implode("','", $this->metricsToKeep) . "') AND name NOT LIKE 'done%'";
foreach ($oldNumericTables as $table) {
Db::deleteAllRows($table, $where, "idarchive ASC", $this->maxRowsToDeletePerQuery);
}
if ($optimize) {
Db::optimizeTables($oldNumericTables);
}
} else {
Db::dropTables($oldNumericTables);
}
}
}
示例6: downgradeFrom
static function downgradeFrom($version)
{
try {
switch ($version) {
case 2:
Db::dropTables(Common::prefixTable('chat_automatic_message'));
$sql = "ALTER TABLE " . Common::prefixTable('chat') . " DROP COLUMN `idautomsg`;";
Db::exec($sql);
break;
case 1:
Db::dropTables(Common::prefixTable('chat'));
Db::dropTables(Common::prefixTable('chat_history_admin'));
Db::dropTables(Common::prefixTable('chat_personnal_informations'));
$sql = "ALTER TABLE " . Common::prefixTable('user') . " DROP COLUMN `last_poll`;";
Db::exec($sql);
break;
}
} catch (Exception $e) {
throw $e;
}
self::setDbVersion($version - 1);
return;
}
示例7: uninstall
public function uninstall()
{
Db::dropTables(array($this->tableNamePrefixed));
}
示例8: uninstall
public function uninstall()
{
Db::dropTables(Common::prefixTable('user_dashboard'));
}
示例9: uninstall
public function uninstall()
{
Db::dropTables(Common::prefixTable("snoopy"));
Db::dropTables(Common::prefixTable("snoopy_visitors"));
Db::dropTables(Common::prefixTable("snoopy_visitors_statuses"));
}
示例10: deletePrivateKeyTable
/**
* Deletes the DB table for private key storage, if exists.
*
* @throws Exception If there is an error in the SQL.
*/
public static function deletePrivateKeyTable()
{
try {
Db::dropTables(Common::prefixTable(static::KEY_TABLE));
} catch (Exception $e) {
// ignore error if table does not exist (1051 code is for 'unknown table')
if (!Db::get()->isErrNo($e, '1051')) {
throw $e;
}
}
}
示例11: uninstall
/**
* Uninstalls the plugins. Derived classes should implement this method if the changes
* made in {@link install()} need to be undone during uninstallation.
*
* In most cases, if you have an {@link install()} method, you should provide
* an {@link uninstall()} method.
*
* @throws \Exception if uninstallation of fails for some reason.
*/
public function uninstall()
{
Db::dropTables(Common::prefixTable('bannerstats'));
}