]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/Database.php
Remove deprecated code
[friendica.git] / src / Database / Database.php
index 3afbfbc8f209ccf58f9828c82b7b4fbfe5786f48..14e186a72f63a4cbf94d31869da5b81e2f5d52eb 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Friendica\Database;
 
-use Friendica\Core\Config\Cache\ConfigCache;
+use Friendica\Core\Config\Cache;
 use Friendica\Core\System;
 use Friendica\Network\HTTPException\InternalServerErrorException;
 use Friendica\Util\DateTimeFormat;
@@ -25,7 +25,7 @@ class Database
        protected $connected = false;
 
        /**
-        * @var ConfigCache
+        * @var Cache
         */
        protected $configCache;
        /**
@@ -47,7 +47,7 @@ class Database
        protected $in_retrial     = false;
        private $relation       = [];
 
-       public function __construct(ConfigCache $configCache, Profiler $profiler, LoggerInterface $logger, array $server = [])
+       public function __construct(Cache $configCache, Profiler $profiler, LoggerInterface $logger, array $server = [])
        {
                // We are storing these values for being able to perform a reconnect
                $this->configCache   = $configCache;
@@ -1342,19 +1342,13 @@ class Database
                        }
                }
 
-               $do_update = (count($old_fields) == 0);
-
                foreach ($old_fields AS $fieldname => $content) {
-                       if (isset($fields[$fieldname])) {
-                               if (($fields[$fieldname] == $content) && !is_null($content)) {
-                                       unset($fields[$fieldname]);
-                               } else {
-                                       $do_update = true;
-                               }
+                       if (isset($fields[$fieldname]) && !is_null($content) && ($fields[$fieldname] == $content)) {
+                               unset($fields[$fieldname]);
                        }
                }
 
-               if (!$do_update || (count($fields) == 0)) {
+               if (count($fields) == 0) {
                        return true;
                }