当前位置: 首页>>代码示例>>PHP>>正文


PHP Db::dropTables方法代码示例

本文整理汇总了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();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:9,代码来源:VisitsSummaryTest.php

示例2: uninstall

 public static function uninstall()
 {
     Db::dropTables(array(Common::prefixTable('alert'), Common::prefixTable('alert_triggered'), Common::prefixTable('alert_site')));
 }
开发者ID:andrzejewsky,项目名称:plugin-CustomAlerts,代码行数:4,代码来源:Model.php

示例3: uninstall

 public static function uninstall()
 {
     Db::dropTables(Common::prefixTable(self::$rawPrefix));
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:4,代码来源:Model.php

示例4: uninstall

 /**
  * @throws Exception if non-recoverable error
  */
 public function uninstall()
 {
     Db::dropTables(Common::prefixTable('user_language'));
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:7,代码来源:LanguagesManager.php

示例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);
         }
     }
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:50,代码来源:ReportsPurger.php

示例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;
 }
开发者ID:WHATNEXTLIMITED,项目名称:piwik-chat,代码行数:23,代码来源:ChatDbManager.php

示例7: uninstall

 public function uninstall()
 {
     Db::dropTables(array($this->tableNamePrefixed));
 }
开发者ID:andrzejewsky,项目名称:plugin-AnonymousPiwikUsageMeasurement,代码行数:4,代码来源:Profiles.php

示例8: uninstall

 public function uninstall()
 {
     Db::dropTables(Common::prefixTable('user_dashboard'));
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:4,代码来源:Dashboard.php

示例9: uninstall

 public function uninstall()
 {
     Db::dropTables(Common::prefixTable("snoopy"));
     Db::dropTables(Common::prefixTable("snoopy_visitors"));
     Db::dropTables(Common::prefixTable("snoopy_visitors_statuses"));
 }
开发者ID:spletnik,项目名称:snoopy-behavioral-scoring,代码行数:6,代码来源:SnoopyBehavioralScoring.php

示例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;
         }
     }
 }
开发者ID:Joey3000,项目名称:piwik-LoginEncrypted,代码行数:16,代码来源:Crypto.php

示例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'));
 }
开发者ID:Ratus,项目名称:VPSCashPiwikBannerPlugin,代码行数:13,代码来源:VpsCashPromo.php


注:本文中的Piwik\Db::dropTables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。