diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-11-04 21:35:20 +0300 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-11-04 21:35:20 +0300 |
commit | 890e1f10ce85d704b02aac129c44bc69b274984b (patch) | |
tree | f29eb9f9eaa7b3afbbf4158dbbb14a2ed9b40e8b | |
parent | 2a49d682fda9f833d3db505fff7c7a22abc831b4 (diff) |
- autoload feature now compatible when upgrading from 0.2.10/11/12
-rw-r--r-- | core/Updater.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/core/Updater.php b/core/Updater.php index 85cd6b656d..2cbc22b512 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -34,7 +34,11 @@ class Piwik_Updater */ public function recordComponentSuccessfullyUpdated($name, $version) { - Piwik_UpdateOption('version_'.$name, $version, $autoload = 1); + try { + Piwik_UpdateOption('version_'.$name, $version, $autoload = 1); + } catch(Exception $e) { + // case when the option table is not yet created (before 0.2.10) + } } /** @@ -132,8 +136,12 @@ class Piwik_Updater foreach($this->componentsToCheck as $name => $version) { - $currentVersion = Piwik_GetOption('version_'.$name); - + try { + $currentVersion = Piwik_GetOption('version_'.$name); + } catch( Exception $e) { + // case when the option table is not yet created (before 0.2.10) + $currentVersion = false; + } if($currentVersion === false) { if($name === 'core') @@ -144,7 +152,9 @@ class Piwik_Updater { $currentVersion = '0.0.1'; } + $this->recordComponentSuccessfullyUpdated($name, $currentVersion); + } $versionCompare = version_compare($currentVersion, $version); |