Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2012-08-17 18:53:21 +0400
committermattpiwik <matthieu.aubry@gmail.com>2012-08-17 18:53:21 +0400
commit8a0676f306ef246719a061afb250a1f8e98a03d8 (patch)
treeb3e5adda1b371f0f97ec588fe2bcb79292599f74 /core/Updater.php
parent2c05e8f607ae4c3a7e40ee1e0e4b5a34e13849da (diff)
No duplicate code + Testing for entryPageUrl/exitPageUrl Refs #2976
git-svn-id: http://dev.piwik.org/svn/trunk@6814 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Updater.php')
-rw-r--r--core/Updater.php24
1 files changed, 5 insertions, 19 deletions
diff --git a/core/Updater.php b/core/Updater.php
index b993c9b46a..dfda38878a 100644
--- a/core/Updater.php
+++ b/core/Updater.php
@@ -28,8 +28,8 @@ class Piwik_Updater
public $pathUpdateFileCore;
public $pathUpdateFilePlugins;
-
private $componentsToCheck = array();
+ private $hasMajorDbUpdate = false;
public function __construct()
{
@@ -99,29 +99,13 @@ class Piwik_Updater
/**
* Does one of the new versions involve a major database update?
+ * Note: getSqlQueriesToExecute() must be called before this method!
*
* @return bool
*/
public function hasMajorDbUpdate()
{
- foreach($this->componentsWithUpdateFile as $componentName => $componentUpdateInfo)
- {
- foreach($componentUpdateInfo as $file => $fileVersion)
- {
- require_once $file;
-
- $className = $this->getUpdateClassName($componentName, $fileVersion);
- if(class_exists($className, false))
- {
- $isMajor = call_user_func( array($className, 'isMajorUpdate'));
- if ($isMajor) {
- return true;
- }
- }
- }
- }
-
- return false;
+ return $this->hasMajorDbUpdate;
}
/**
@@ -145,6 +129,8 @@ class Piwik_Updater
foreach($queriesForComponent as $query => $error) {
$queries[] = $query.';';
}
+
+ $this->hasMajorDbUpdate = $this->hasMajorDbUpdate || call_user_func( array($className, 'isMajorUpdate'));
}
}
// unfortunately had to extract this query from the Piwik_Option class