]> git.mxchange.org Git - friendica.git/commitdiff
Improve performance of settings save by not querying the DB if submitted value is...
authorHypolite Petovan <mrpetovan@gmail.com>
Mon, 17 Oct 2016 20:54:22 +0000 (16:54 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Mon, 17 Oct 2016 20:54:22 +0000 (16:54 -0400)
include/Core/Config.php
include/Core/PConfig.php

index bc2bc1fad7f735e9997412ca321e9688bf4a6e4a..46972e1eb731947ce219b2eb90309b36eec16105 100644 (file)
@@ -126,6 +126,10 @@ class Config {
        public static function set($family, $key, $value) {
                global $a;
 
+        if (self::get($family, $key) === $value) {
+            return true;
+        }
+
                $a->config[$family][$key] = $value;
 
                // manage array value
index c6821a266754875a252b263c819c77c598ddc462..1d0f7fc82c2bb6fffe5bb5f059d7593bb379e16e 100644 (file)
@@ -123,6 +123,10 @@ class PConfig {
 
                global $a;
 
+        if (self::get($uid, $family, $key) === $value) {
+            return true;
+        }
+
                // manage array value
                $dbvalue = (is_array($value)?serialize($value):$value);