diff --git a/src/bb-library/Box/Update.php b/src/bb-library/Box/Update.php index 64803033c..e049a177e 100644 --- a/src/bb-library/Box/Update.php +++ b/src/bb-library/Box/Update.php @@ -150,7 +150,7 @@ class Box_Update } //Migrate the configuration file - $this->di['tools']->updateConfig(); + $this->performConfigUpdate(); // clean up things $this->di['tools']->emptyFolder(BB_PATH_CACHE); @@ -158,4 +158,14 @@ class Box_Update rmdir(BB_PATH_ROOT.'/install'); return true; } + + /** + * Perform config file update + * + * @throws Exception + */ + public function performConfigUpdate() + { + return $this->di['tools']->updateConfig(); + } } diff --git a/src/bb-modules/Extension/Api/Admin.php b/src/bb-modules/Extension/Api/Admin.php index 868d97565..498f6522d 100644 --- a/src/bb-modules/Extension/Api/Admin.php +++ b/src/bb-modules/Extension/Api/Admin.php @@ -111,6 +111,24 @@ class Admin extends \Api_Abstract return true; } + /** + * Update FOSSBilling config. + * + * @return bool + * + * @throws Box_Exception + * @throws Exception + */ + public function update_config($data) + { + $updater = $this->di['updater']; + $updater->performConfigUpdate(); + + $this->di['logger']->info('Updated FOSSBilling config'); + + return true; + } + /** * Update existing extension. * diff --git a/src/bb-themes/admin_default/html/mod_extension_index.html.twig b/src/bb-themes/admin_default/html/mod_extension_index.html.twig index 68c24b318..e787975ca 100644 --- a/src/bb-themes/admin_default/html/mod_extension_index.html.twig +++ b/src/bb-themes/admin_default/html/mod_extension_index.html.twig @@ -109,6 +109,17 @@
+

{{ 'Migrate configuration file'|trans }}

+

{{ 'Use this too to automatically migrate your configuration file to be compatible with the latest FOSSBilling changes. Note: this is only needed when performing manual updates'|trans }}

+ + + + + + {{ 'Migrate configuration'|trans }} + +
+

{{ 'Manual update'|trans }}

{{ 'Manual update is a solution when auto updater can not work on current installation environment'|trans }}