- $build = Core\Config::get('system', 'build');
- if (empty($build)) {
- Core\Config::set('system', 'build', DB_UPDATE_VERSION);
- $build = DB_UPDATE_VERSION;
- }
-
- $stored = intval($build);
- $current = intval(DB_UPDATE_VERSION);
-
- // run the pre_update_nnnn functions in update.php
- for ($x = $stored; $x < $current; $x ++) {
- $r = run_update_function($x, 'pre_update');
- if (!$r) {
- break;
- }
- }
-
- $output = DBStructure::update(true, true);
-
- // run the update_nnnn functions in update.php
- for ($x = $stored; $x < $current; $x ++) {
- $r = run_update_function($x, 'update');
- if (!$r) {
- break;
- }
- }
-
- Core\Config::set('system', 'build', DB_UPDATE_VERSION);
+ $force = $this->getOption(['f', 'force'], false);
+ $output = Update::run($force, true, false);