diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-04-15 05:31:30 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-04-15 05:31:30 +0400 |
commit | ee0ed65a417df1d22221f321718d5d34e767be75 (patch) | |
tree | 1881ef1f016d612f4fd200cdfb06d076eb002c71 /core/Db | |
parent | 906ea4ca4b767c4849c26a9ccaf1f6f857642846 (diff) |
Fixes #4991 Deprecated the function Schema::dropTables() and DbHelper::dropTables.
Please use the new Db::dropTables() instead.
Next time we will give a bit more head-ups so you have more time to modify plugins. Thanks!
Diffstat (limited to 'core/Db')
-rw-r--r-- | core/Db/Schema.php | 10 | ||||
-rw-r--r-- | core/Db/Schema/Mysql.php | 23 | ||||
-rw-r--r-- | core/Db/SchemaInterface.php | 7 |
3 files changed, 0 insertions, 40 deletions
diff --git a/core/Db/Schema.php b/core/Db/Schema.php index 065a9c973d..b7de26b6e3 100644 --- a/core/Db/Schema.php +++ b/core/Db/Schema.php @@ -212,16 +212,6 @@ class Schema extends Singleton } /** - * Drop specific tables - * - * @param array $doNotDelete - */ - public function dropTables($doNotDelete = array()) - { - $this->getSchema()->dropTables($doNotDelete); - } - - /** * Names of all the prefixed tables in piwik * Doesn't use the DB * diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php index 34c3764f2f..bb5cc214bb 100644 --- a/core/Db/Schema/Mysql.php +++ b/core/Db/Schema/Mysql.php @@ -514,29 +514,6 @@ class Mysql implements SchemaInterface } } - /** - * Drop specific tables - * - * @param array $doNotDelete Names of tables to not delete - */ - public function dropTables($doNotDelete = array()) - { - $tablesAlreadyInstalled = $this->getTablesInstalled(); - $db = Db::get(); - - $doNotDeletePattern = '/(' . implode('|', $doNotDelete) . ')/'; - - foreach ($tablesAlreadyInstalled as $tableName) { - if (count($doNotDelete) == 0 - || (!in_array($tableName, $doNotDelete) - && !preg_match($doNotDeletePattern, $tableName) - ) - ) { - $db->query("DROP TABLE `$tableName`"); - } - } - } - private function getTablePrefix() { $dbInfos = Db::getDatabaseConfig(); diff --git a/core/Db/SchemaInterface.php b/core/Db/SchemaInterface.php index 18888fae7b..71bc1b7d41 100644 --- a/core/Db/SchemaInterface.php +++ b/core/Db/SchemaInterface.php @@ -72,13 +72,6 @@ interface SchemaInterface public function truncateAllTables(); /** - * Drop specific tables - * - * @param array $doNotDelete Names of tables to not delete - */ - public function dropTables($doNotDelete = array()); - - /** * Names of all the prefixed tables in piwik * Doesn't use the DB * |