diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-03-02 04:22:46 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-03-02 04:22:46 +0400 |
commit | 838a7abca8a1fce9a8dda3c8654bd4006c1395f3 (patch) | |
tree | 1f5c8408dc1204a2f815438e5af986387aedc298 | |
parent | 0bdc6dc127aa7d3e096a7b190fb1bf262e96588c (diff) | |
parent | 434a88024140c9b2f831fec3d0f8d7bff5a3f22e (diff) |
Merge remote-tracking branch 'origin/master'1.11-b1
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | core/ArchiveProcessing.php | 14 | ||||
-rw-r--r-- | core/FrontController.php | 5 | ||||
-rw-r--r-- | core/Http.php | 5 | ||||
-rw-r--r-- | core/PluginsManager.php | 10 | ||||
-rw-r--r-- | core/Session.php | 11 | ||||
-rwxr-xr-x | plugins/UserCountry/GeoIPAutoUpdater.php | 4 | ||||
-rwxr-xr-x | plugins/UserCountry/LocationProvider/GeoIp/Php.php | 2 |
8 files changed, 28 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml index b420cc6233..97d004a4a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ env: - TEST_SUITE=CoreTests - TEST_SUITE=IntegrationTests -script: phpunit --configuration phpunit.xml --testsuite $TEST_SUITE --coverage-text +script: phpunit --configuration phpunit.xml --testsuite $TEST_SUITE --coverage-text --colors before_script: - mysql -e 'create database piwik_test;' diff --git a/core/ArchiveProcessing.php b/core/ArchiveProcessing.php index b16bc343e7..099b0824a5 100644 --- a/core/ArchiveProcessing.php +++ b/core/ArchiveProcessing.php @@ -567,11 +567,15 @@ abstract class Piwik_ArchiveProcessing { $temporary = 'temporary archive'; } - Piwik::log("'" . $this->period->getLabel() . "'" - .", idSite = ". $this->idsite." ($temporary)" - .", segment = '". $this->getSegment()->getString()."'" - .", report = '". $this->getRequestedReport()."'" - .", UTC datetime [".$this->startDatetimeUTC." -> ".$this->endDatetimeUTC." ]..."); + Piwik::log(sprintf("'%s, idSite = %d (%s), segment '%s', report = '%s', UTC datetime [%s -> %s]", + $this->period->getLabel(), + $this->idsite, + $temporary, + $this->getSegment()->getString(), + $this->getRequestedReport(), + $this->startDatetimeUTC, + $this->endTimestampUTC + )); } /** diff --git a/core/FrontController.php b/core/FrontController.php index 411c13d428..055f4058aa 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -121,8 +121,7 @@ class Piwik_FrontController { $action = $controller->getDefaultAction(); } - -// Piwik::log("Dispatching $module / $action, parameters: ".var_export($parameters, $return = true)); + if( !is_callable(array($controller, $action))) { throw new Exception("Action '$action' not found in the controller '$controllerClassName'."); @@ -328,8 +327,6 @@ class Piwik_FrontController Piwik_ExitWithMessage($e->getMessage(), false, true); } - -// Piwik::log('End FrontController->init() - Request: '. var_export($_REQUEST, true)); } protected function handleMaintenanceMode() diff --git a/core/Http.php b/core/Http.php index 33f5b308c8..7e921d354d 100644 --- a/core/Http.php +++ b/core/Http.php @@ -636,7 +636,7 @@ class Piwik_Http if ($expectedFileSize == 0) { - Piwik::log("HEAD request for '$url' failed, got following: ".print_r($expectedFileSizeResult, true)); + Piwik::log(sprintf("HEAD request for '%s' failed, got following: %s", $url, print_r($expectedFileSizeResult, true))); throw new Exception(Piwik_Translate('General_DownloadFail_HttpRequestFail')); } @@ -647,8 +647,7 @@ class Piwik_Http $expectedFileSize = (int)Piwik_GetOption($downloadOption); if ($expectedFileSize === false) // sanity check { - throw new Exception( - "Trying to continue a download that never started?! That's not supposed to happen..."); + throw new Exception("Trying to continue a download that never started?! That's not supposed to happen..."); } } diff --git a/core/PluginsManager.php b/core/PluginsManager.php index 6d60ef2653..ae6980bf02 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -240,7 +240,7 @@ class Piwik_PluginsManager $existingPlugins = $this->readPluginsDirectory(); if( array_search($pluginName, $existingPlugins) === false) { - Piwik::log("Unable to find the plugin '$pluginName' in activatePlugin."); + Piwik::log(sprintf("Unable to find the plugin '%s' in activatePlugin.", $pluginName)); return; } @@ -423,19 +423,19 @@ class Piwik_PluginsManager { return $this->loadedPlugins[$pluginName]; } - $pluginFileName = $pluginName . '/' . $pluginName . '.php'; - $pluginClassName = 'Piwik_'.$pluginName; + $pluginFileName = sprintf("%s/%s.php", $pluginName, $pluginName); + $pluginClassName = sprintf('Piwik_%s', $pluginName); if( !Piwik_Common::isValidFilename($pluginName)) { - throw new Exception("The plugin filename '$pluginFileName' is not a valid filename"); + throw new Exception(sprintf("The plugin filename '%s' is not a valid filename", $pluginFileName)); } $path = PIWIK_INCLUDE_PATH . '/plugins/' . $pluginFileName; if(!file_exists($path)) { -// Piwik::log("Unable to load plugin '$pluginName' because '$path' couldn't be found."); + Piwik::log(sprintf("Unable to load plugin '%s' because '%s' couldn't be found.", $pluginName, $path)); return null; } diff --git a/core/Session.php b/core/Session.php index 119bbf6397..8f5f5912ab 100644 --- a/core/Session.php +++ b/core/Session.php @@ -129,10 +129,13 @@ class Piwik_Session extends Zend_Session we recommend that you <a href='http://piwik.org/faq/how-to-install/#faq_133' target='_blank'>enable database session storage</a>."; } - $message = 'Error: ' . Piwik_Translate('General_ExceptionUnableToStartSession') - . ' ' .Piwik::getErrorMessageMissingPermissions(Piwik_Common::getPathToPiwikRoot() . '/tmp/sessions/') - . $enableDbSessions - . "\n<pre>Debug: the original error was \n". $e->getMessage()."</pre>"; + $message = sprintf("Error: %s %s %s\n<pre>Debug: the original error was \n%s</pre>", + Piwik_Translate('General_ExceptionUnableToStartSession'), + Piwik::getErrorMessageMissingPermissions(Piwik_Common::getPathToPiwikRoot() . '/tmp/sessions/'), + $enableDbSessions, + $e->getMessage() + ); + Piwik_ExitWithMessage($message); } } diff --git a/plugins/UserCountry/GeoIPAutoUpdater.php b/plugins/UserCountry/GeoIPAutoUpdater.php index 912425e998..1f29d8a1bb 100755 --- a/plugins/UserCountry/GeoIPAutoUpdater.php +++ b/plugins/UserCountry/GeoIPAutoUpdater.php @@ -112,7 +112,7 @@ class Piwik_UserCountry_GeoIPAutoUpdater . "'$zippedOutputPath'! (Unknown error)"); } - Piwik::log("Piwik_UserCountry_GeoIPAutoUpdater: successfully downloaded '$url'"); + Piwik::log(sprintf("Piwik_UserCountry_GeoIPAutoUpdater: successfully downloaded '%s'", $url)); try { @@ -124,7 +124,7 @@ class Piwik_UserCountry_GeoIPAutoUpdater . "downloading " . "'$url': ".$ex->getMessage()); } - Piwik::log("Piwik_UserCountry_GeoIPAutoUpdater: successfully updated GeoIP database '$url'"); + Piwik::log(sprintf("Piwik_UserCountry_GeoIPAutoUpdater: successfully updated GeoIP database '%s'", $url)); } /** diff --git a/plugins/UserCountry/LocationProvider/GeoIp/Php.php b/plugins/UserCountry/LocationProvider/GeoIp/Php.php index f12878344a..c2443822fd 100755 --- a/plugins/UserCountry/LocationProvider/GeoIp/Php.php +++ b/plugins/UserCountry/LocationProvider/GeoIp/Php.php @@ -133,7 +133,7 @@ class Piwik_UserCountry_LocationProvider_GeoIp_Php extends Piwik_UserCountry_Loc $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip); break; default: // unknown database type, log warning and fallback to country edition - Piwik::log("Found unrecognized database type: ".$locationGeoIp->databaseType); + Piwik::log(sprintf("Found unrecognized database type: %s", $locationGeoIp->databaseType)); $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip); break; |