]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBA.php
Fix storage backend class names
[friendica.git] / src / Database / DBA.php
index af0c25d0dd749c34e0e48142148e390f7357a69c..6064e587a6dd2605ee42a156e4846ea9ef4566a5 100644 (file)
@@ -16,8 +16,6 @@ use PDO;
 use PDOException;
 use PDOStatement;
 
-require_once 'include/dba.php';
-
 /**
  * @class MySQL database class
  *
@@ -210,7 +208,7 @@ class DBA
         * @param string $query The database query that will be analyzed
         */
        private static function logIndex($query) {
-               $a = get_app();
+               $a = \get_app();
 
                if (!$a->getConfigVariable('system', 'db_log_index')) {
                        return;
@@ -390,7 +388,7 @@ class DBA
         * @return bool|object statement object or result object
         */
        public static function p($sql) {
-               $a = get_app();
+               $a = \get_app();
 
                $stamp1 = microtime(true);
 
@@ -608,7 +606,7 @@ class DBA
         * @return boolean Was the query successfull? False is returned only if an error occurred
         */
        public static function e($sql) {
-               $a = get_app();
+               $a = \get_app();
 
                $stamp = microtime(true);
 
@@ -772,7 +770,7 @@ class DBA
         * @return array current row
         */
        public static function fetch($stmt) {
-               $a = get_app();
+               $a = \get_app();
 
                $stamp1 = microtime(true);
 
@@ -1241,7 +1239,7 @@ class DBA
 
                foreach ($old_fields AS $fieldname => $content) {
                        if (isset($fields[$fieldname])) {
-                               if ($fields[$fieldname] == $content) {
+                               if (($fields[$fieldname] == $content) && !is_null($content)) {
                                        unset($fields[$fieldname]);
                                } else {
                                        $do_update = true;
@@ -1520,7 +1518,7 @@ class DBA
         * @return boolean was the close successful?
         */
        public static function close($stmt) {
-               $a = get_app();
+               $a = \get_app();
 
                $stamp1 = microtime(true);