From 69a3f66d563ea0a006000dc3c64254617976b30c Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Aug 2017 21:34:39 +0000 Subject: [PATCH] Just more simplyfication --- src/Core/Config.php | 6 +----- src/Core/PConfig.php | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Core/Config.php b/src/Core/Config.php index 0cdccb953a..f3c5dc13a1 100644 --- a/src/Core/Config.php +++ b/src/Core/Config.php @@ -163,11 +163,7 @@ class Config { // manage array value $dbvalue = (is_array($value) ? serialize($value) : $dbvalue); - if (is_null($stored) || !self::$in_db[$family][$key]) { - dba::insert('config', array('cat' => $family, 'k' => $key, 'v' => $dbvalue), true); - } else { - dba::update('config', array('v' => $dbvalue), array('cat' => $family, 'k' => $key), true); - } + dba::update('config', array('v' => $dbvalue), array('cat' => $family, 'k' => $key), true); if ($ret) { self::$in_db[$family][$key] = true; diff --git a/src/Core/PConfig.php b/src/Core/PConfig.php index e5a852e403..8080573331 100644 --- a/src/Core/PConfig.php +++ b/src/Core/PConfig.php @@ -141,11 +141,7 @@ class PConfig { // manage array value $dbvalue = (is_array($value) ? serialize($value) : $dbvalue); - if (is_null($stored) || !self::$in_db[$uid][$family][$key]) { - dba::insert('pconfig', array('uid' => $uid, 'cat' => $family, 'k' => $key, 'v' => $dbvalue), true); - } else { - dba::update('pconfig', array('v' => $dbvalue), array('uid' => $uid, 'cat' => $family, 'k' => $key), true); - } + dba::update('pconfig', array('v' => $dbvalue), array('uid' => $uid, 'cat' => $family, 'k' => $key), true); if ($ret) { self::$in_db[$uid][$family][$key] = true; -- 2.39.5