remove basepath and hostname from admin panel and add update path
This commit is contained in:
parent
383a6715c3
commit
fa31bb6dde
10 changed files with 158 additions and 35 deletions
30
update.php
30
update.php
|
@ -12,6 +12,7 @@ use Friendica\Model\Contact;
|
|||
use Friendica\Model\GContact;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Util\Config\ConfigCacheSaver;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
/**
|
||||
|
@ -346,3 +347,32 @@ function update_1298()
|
|||
}
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://github.com/friendica/friendica/pull/6815
|
||||
*
|
||||
* @return int Success
|
||||
*/
|
||||
function update_1303()
|
||||
{
|
||||
$app = \Friendica\BaseObject::getApp();
|
||||
$configCache = $app->getConfigCache();
|
||||
$configCacheSaver = new ConfigCacheSaver($app->getBasePath());
|
||||
$updateConfigEntry = function($cat, $key) use ($configCache, $configCacheSaver) {
|
||||
// check if the config file differs from the whole configuration (= The db contains other values)
|
||||
$fileConfig = $configCache->get($cat, $key);
|
||||
if ($fileConfig === '!<unset>!') {
|
||||
$fileConfig = null;
|
||||
}
|
||||
$savedConfig = Config::get($cat, $key, null, true);
|
||||
if ($fileConfig !== $savedConfig) {
|
||||
Logger::info('Difference in config found', ['cat' => $cat, 'key' => $key, 'file' => $fileConfig, 'saved' => $savedConfig]);
|
||||
$configCacheSaver->saveToConfigFile($cat, $key, $savedConfig);
|
||||
} else {
|
||||
Logger::info('No Difference in config found', ['cat' => $cat, 'key' => $key, 'value' => $fileConfig, 'saved' => $savedConfig]);
|
||||
}
|
||||
};
|
||||
$updateConfigEntry('config', 'hostname');
|
||||
$updateConfigEntry('system', 'basepath');
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue