From c77688ccc24f0ed0e72074671b130d2b9e9f4657 Mon Sep 17 00:00:00 2001 From: mattab <matthieu.aubry@gmail.com> Date: Mon, 14 Dec 2015 12:35:08 +1300 Subject: [PATCH] Remove DB::tableExists method --- CHANGELOG.md | 3 +++ core/Db.php | 11 ----------- plugins/CoreConsole/Commands/ManagePlugin.php | 2 +- tests/PHPUnit/Integration/DbTest.php | 6 ------ 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4240a3546..bc7213d368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' * Add your own SMS/Text provider by creating a new class in the `SMSProvider` directory of your plugin. The class has to extend `Piwik\Plugins\MobileMessaging\SMSProvider` and implement the required methods. * Segments can now be composed by a union of multiple segments. To do this set an array of segments that shall be used for that segment `$segment->setUnionOfSegments(array('outlinkUrl', 'downloadUrl'))` instead of defining a SQL column. +### Deprecations + * The method `DB::tableExists` was un-used and has been removed. + ## Piwik 2.15.0 ### New commands diff --git a/core/Db.php b/core/Db.php index 387f9c7a4d..a4b114d634 100644 --- a/core/Db.php +++ b/core/Db.php @@ -631,17 +631,6 @@ class Db } } - /** - * Returns `true` if a table in the database, `false` if otherwise. - * - * @param string $tableName The name of the table to check for. Must be prefixed. - * @return bool - */ - public static function tableExists($tableName) - { - return self::query("SHOW TABLES LIKE ?", $tableName)->rowCount() > 0; - } - /** * Attempts to get a named lock. This function uses a timeout of 1s, but will * retry a set number of times. diff --git a/plugins/CoreConsole/Commands/ManagePlugin.php b/plugins/CoreConsole/Commands/ManagePlugin.php index 1c2a4de0b7..3f07918f7c 100644 --- a/plugins/CoreConsole/Commands/ManagePlugin.php +++ b/plugins/CoreConsole/Commands/ManagePlugin.php @@ -41,7 +41,7 @@ class ManagePlugin extends ConsoleCommand } /** - * Execute command like: ./console cloudadmin:plugin activate CustomAlerts --piwik-domain=testcustomer.piwik.pro + * Execute command like: ./console core:plugin activate CustomAlerts --piwik-domain=testcustomer.piwik.pro */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/tests/PHPUnit/Integration/DbTest.php b/tests/PHPUnit/Integration/DbTest.php index 67b6709796..e30de8a062 100644 --- a/tests/PHPUnit/Integration/DbTest.php +++ b/tests/PHPUnit/Integration/DbTest.php @@ -85,12 +85,6 @@ class DbTest extends IntegrationTestCase Db::destroyDatabaseObject(); } - public function test_tableExists() - { - $this->assertFalse(Db::tableExists('noTExistIngTable')); - $this->assertTrue(Db::tableExists(Common::prefixTable('log_visit'))); - } - public function getDbAdapter() { return array( -- GitLab