當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。