mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 15:54:26 +02:00
Just commit config transactions if something changed
This commit is contained in:
parent
aabe39220d
commit
dce86be58e
3 changed files with 34 additions and 8 deletions
|
@ -175,35 +175,28 @@ class BaseURL
|
|||
$currUrl = $this->url;
|
||||
|
||||
$configTransaction = $this->config->beginTransaction();
|
||||
$savable = false;
|
||||
|
||||
if (!empty($hostname) && $hostname !== $this->hostname) {
|
||||
$configTransaction->set('config', 'hostname', $hostname);
|
||||
$this->hostname = $hostname;
|
||||
$savable = true;
|
||||
}
|
||||
|
||||
if (isset($sslPolicy) && $sslPolicy !== $this->sslPolicy) {
|
||||
$configTransaction->set('system', 'ssl_policy', $sslPolicy);
|
||||
$this->sslPolicy = $sslPolicy;
|
||||
$savable = true;
|
||||
}
|
||||
|
||||
if (isset($urlPath) && $urlPath !== $this->urlPath) {
|
||||
$configTransaction->set('system', 'urlpath', $urlPath);
|
||||
$this->urlPath = $urlPath;
|
||||
$savable = true;
|
||||
}
|
||||
|
||||
$this->determineBaseUrl();
|
||||
if ($this->url !== $currUrl) {
|
||||
$configTransaction->set('system', 'url', $this->url);
|
||||
$savable = true;
|
||||
}
|
||||
|
||||
if ($savable) {
|
||||
$configTransaction->commit();
|
||||
}
|
||||
$configTransaction->commit();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue