diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-26 04:16:38 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-26 04:16:38 +0400 |
commit | d2fc5e31085ea699d5593d7078f8bae5787d66ac (patch) | |
tree | 4fc71e23cd82a8248fca3cb060b9447802057965 /core/Updater.php | |
parent | 219fe98c254d3272d02c9a98488d09ff7ab85a26 (diff) |
smarter install and update of columns which will automatically update the column in case the type changes making it super easy for developers, not sure if everything works already and need to xhprof it
Diffstat (limited to 'core/Updater.php')
-rw-r--r-- | core/Updater.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/Updater.php b/core/Updater.php index d0b2fd9ad3..9e58572900 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -210,6 +210,8 @@ class Updater $componentsWithUpdateFile = array(); $hasDimensionUpdate = null; + ColumnUpdates::setUpdater($this); + foreach ($this->componentsWithNewVersion as $name => $versions) { $currentVersion = $versions[self::INDEX_CURRENT_VERSION]; $newVersion = $versions[self::INDEX_NEW_VERSION]; @@ -217,7 +219,7 @@ class Updater if ($name == 'core') { $pathToUpdates = $this->pathUpdateFileCore . '*.php'; } elseif ($this->isDimensionComponent($name)) { - if (is_null($hasDimensionUpdate)) { + if (!$hasDimensionUpdate) { $hasDimensionUpdate = ColumnUpdates::hasUpdates(); } if ($hasDimensionUpdate) { @@ -295,10 +297,14 @@ class Updater self::recordComponentSuccessfullyUpdated($name, $currentVersion); } - // note: when versionCompare == 1, the version in the DB is newer, we choose to ignore - $currentVersionIsOutdated = version_compare($currentVersion, $version) == -1; - $isComponentOutdated = $currentVersion === false || $currentVersionIsOutdated; - if ($isComponentOutdated) { + if ($this->isDimensionComponent($name)) { + $isComponentOutdated = $currentVersion !== $version; + } else { + // note: when versionCompare == 1, the version in the DB is newer, we choose to ignore + $isComponentOutdated = version_compare($currentVersion, $version) == -1; + } + + if ($isComponentOutdated || $currentVersion === false) { $componentsToUpdate[$name] = array( self::INDEX_CURRENT_VERSION => $currentVersion, self::INDEX_NEW_VERSION => $version |