CLI upgrader, better handling of out-of-sequence plugin upgrades
Bug 1614805. When a plugin is installed "out of sequence" by a
call to plugin_upgrade in the core lib/db/upgrade.php file, the
AJAX-based web upgrader handles it gracefully, because it does
check_upgrade() before upgrading each plugin, detects the change
in status, and doesn't run the upgrade for that plugin a second
time.
The CLI upgrader, on the other hand, uses the same cached data
from check_upgrades() all the way through, causing it to re-run
upgrades for such plugins.
This patch makes it behave the same as the AJAX plugin, running
check_upgrade() again immediately before each component gets
upgraded. This does cause some redundancy in code execution,
but it shouldn't be enough to cause a noticeable performance hit.
Change-Id: Id5c431fc9e636df2cab05d22e6cc424271ce9f3d
behatnotneeded: Covered by existing tests
Reviewed: https:/ /reviews. mahara. org/6872 /git.mahara. org/mahara/ mahara/ commit/ 0e1704c1365bf37 2ee4a56cebe0785 f130dc139e
Committed: https:/
Submitter: Aaron Wells (<email address hidden>)
Branch: master
commit 0e1704c1365bf37 2ee4a56cebe0785 f130dc139e
Author: Aaron Wells <email address hidden>
Date: Fri Aug 19 15:04:27 2016 +1200
CLI upgrader, better handling of out-of-sequence plugin upgrades
Bug 1614805. When a plugin is installed "out of sequence" by a
call to plugin_upgrade in the core lib/db/upgrade.php file, the
AJAX-based web upgrader handles it gracefully, because it does
check_upgrade() before upgrading each plugin, detects the change
in status, and doesn't run the upgrade for that plugin a second
time.
The CLI upgrader, on the other hand, uses the same cached data
from check_upgrades() all the way through, causing it to re-run
upgrades for such plugins.
This patch makes it behave the same as the AJAX plugin, running
check_upgrade() again immediately before each component gets
upgraded. This does cause some redundancy in code execution,
but it shouldn't be enough to cause a noticeable performance hit.
Change-Id: Id5c431fc9e636d f2cab05d22e6cc4 24271ce9f3d
behatnotneeded: Covered by existing tests