diff options
author | BeezyT <timo@ezdesign.de> | 2012-08-16 17:59:26 +0400 |
---|---|---|
committer | BeezyT <timo@ezdesign.de> | 2012-08-16 17:59:26 +0400 |
commit | 2dfe749fce7c817aaa0a9ebd30bf5282a372d84c (patch) | |
tree | d345c7824c4a0cf2e45babd68dc24b5a007b0cc5 /core/Updater.php | |
parent | 4de9cfa37f2d56deb18843f35db2b1cee471afd9 (diff) |
refs #2976 updates can be marked a major
git-svn-id: http://dev.piwik.org/svn/trunk@6790 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Updater.php')
-rw-r--r-- | core/Updater.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/Updater.php b/core/Updater.php index ae3821d080..b993c9b46a 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -98,6 +98,33 @@ class Piwik_Updater } /** + * Does one of the new versions involve a major database update? + * + * @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; + } + + /** * Returns the list of SQL queries that would be executed during the update * * @return array of SQL queries |