Adding ConfigFileSaver and tests

This commit is contained in:
Philipp Holzer 2019-03-24 12:54:26 +01:00
parent fa31bb6dde
commit 49def0dc27
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
21 changed files with 493 additions and 473 deletions

View file

@ -1087,8 +1087,9 @@ function admin_page_site_post(App $a)
update_table($a, "gcontact", ['connect', 'addr'], $old_host, $new_host);
// update config
$configCacheSaver = new \Friendica\Util\Config\ConfigCacheSaver($a->getBasePath());
$configCacheSaver->saveToConfigFile('system', 'hostname', parse_url($new_url, PHP_URL_HOST));
$configFileSaver = new \Friendica\Util\Config\ConfigFileSaver($a->getBasePath());
$configFileSaver->addConfigValue('system', 'hostname', parse_url($new_url, PHP_URL_HOST));
$configFileSaver->saveToConfigFile();
Config::set('system', 'hostname', parse_url($new_url, PHP_URL_HOST));
Config::set('system', 'url', $new_url);
$a->setBaseURL($new_url);