From 6f2c8681ea071afa47e72df6bd2884fd0b4ce421 Mon Sep 17 00:00:00 2001 From: Thomas Steur <thomas.steur@googlemail.com> Date: Mon, 7 Jul 2014 12:31:40 +0200 Subject: [PATCH] it looks like it truncates all tables between tests? --- core/Db/Schema/Mysql.php | 3 +++ core/DbHelper.php | 4 ---- core/Tracker.php | 2 -- plugins/PrivacyManager/Config.php | 4 ---- plugins/PrivacyManager/IPAnonymizer.php | 14 -------------- tests/LocalTracker.php | 8 -------- 6 files changed, 3 insertions(+), 32 deletions(-) diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php index 80356c1794..e8ee737bf0 100644 --- a/core/Db/Schema/Mysql.php +++ b/core/Db/Schema/Mysql.php @@ -462,6 +462,9 @@ class Mysql implements SchemaInterface */ public function truncateAllTables() { + $message = 'truncateAllTables'; + \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); + $tablesAlreadyInstalled = $this->getTablesInstalled($forceReload = true); foreach ($tablesAlreadyInstalled as $table) { Db::query("TRUNCATE `$table`"); diff --git a/core/DbHelper.php b/core/DbHelper.php index 2b2d47a46a..8dbf7d0a9e 100644 --- a/core/DbHelper.php +++ b/core/DbHelper.php @@ -106,10 +106,6 @@ class DbHelper */ public static function dropDatabase($dbName = null) { - - $message = 'Drop DB '; - \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - if (defined('PIWIK_TEST_MODE') && PIWIK_TEST_MODE) { Schema::getInstance()->dropDatabase($dbName); } diff --git a/core/Tracker.php b/core/Tracker.php index 29973c8981..90ca70ff53 100644 --- a/core/Tracker.php +++ b/core/Tracker.php @@ -801,8 +801,6 @@ class Tracker self::connectDatabaseIfNotConnected(); - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt('forceIpAnonymization'); - $privacyConfig = new PrivacyManagerConfig(); $privacyConfig->ipAddressMaskLength = 2; diff --git a/plugins/PrivacyManager/Config.php b/plugins/PrivacyManager/Config.php index 5a3d5c8a4e..a1e3929fa5 100644 --- a/plugins/PrivacyManager/Config.php +++ b/plugins/PrivacyManager/Config.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\PrivacyManager; -use Piwik\Log; use Piwik\Option; use Piwik\Tracker\Cache; @@ -94,9 +93,6 @@ class Config settype($value, $config['type']); } - $message = 'set new value ' . $name . ' : ' . $value; - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message); - Option::set($this->prefix($name), $value); Cache::clearCacheGeneral(); } diff --git a/plugins/PrivacyManager/IPAnonymizer.php b/plugins/PrivacyManager/IPAnonymizer.php index bad1a76035..34b176eedb 100644 --- a/plugins/PrivacyManager/IPAnonymizer.php +++ b/plugins/PrivacyManager/IPAnonymizer.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\PrivacyManager; use Piwik\Common; -use Piwik\Config as PiwikConfig; use Piwik\IP; use Piwik\Log; @@ -88,19 +87,6 @@ class IPAnonymizer */ public static function activate() { - $dbConfig = PiwikConfig::getInstance()->database; - $message = 'DB Config ' . var_export($dbConfig, 1); - \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - - $privacyOptions = \Piwik\Option::getLike('PrivacyManager'); - $message = 'Privacy Options ' . var_export($privacyOptions, 1); - \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - - $message = 'activate anonmyizer'; - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message); - $message = var_export($_SERVER, 1); - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - $privacyConfig = new Config(); $privacyConfig->ipAnonymizerEnabled = true; } diff --git a/tests/LocalTracker.php b/tests/LocalTracker.php index 003d48cf99..366996b465 100755 --- a/tests/LocalTracker.php +++ b/tests/LocalTracker.php @@ -43,14 +43,6 @@ class Piwik_LocalTracker extends PiwikTracker $requests = array($testEnvironmentArgs); } - $dbConfig = Config::getInstance()->database; - $message = 'DB Config ' . var_export($dbConfig, 1); - \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - - $privacyOptions = \Piwik\Option::getLike('PrivacyManager'); - $message = 'Privacy Options ' . var_export($privacyOptions, 1); - \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - // unset cached values Cache::$trackerCache = null; Tracker::setForceIp(null); -- GitLab