]> git.mxchange.org Git - friendica.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Tue, 21 Jun 2022 11:04:05 +0000 (13:04 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 21 Jun 2022 11:47:39 +0000 (13:47 +0200)
- Database->$driver can no longer be NULL, an empty string is fine anyway

src/Database/DBA.php
src/Database/Database.php

index 68fb32f9a27aa7b96fd76da5ef3ab842caa76781..d428f36f5a91af3c9ae15e13ca1cdda0426734bf 100644 (file)
@@ -77,7 +77,7 @@ class DBA
         *
         * @return string with either "pdo" or "mysqli"
         */
-       public static function getDriver()
+       public static function getDriver(): string
        {
                return DI::dba()->getDriver();
        }
index fbdde000c12d050ab1026df427f4f6e69c5996ee..a77494d69ad62b382063368709d3e14d6e5cc408 100644 (file)
@@ -64,7 +64,7 @@ class Database
        protected $server_info    = '';
        /** @var PDO|mysqli */
        protected $connection;
-       protected $driver;
+       protected $driver = '';
        protected $pdo_emulate_prepares = false;
        private $error          = false;
        private $errorno        = 0;
@@ -181,7 +181,7 @@ class Database
 
                // No suitable SQL driver was found.
                if (!$this->connected) {
-                       $this->driver     = null;
+                       $this->driver     = '';
                        $this->connection = null;
                }
 
@@ -233,7 +233,7 @@ class Database
                        }
                }
 
-               $this->driver    = null;
+               $this->driver    = '';
                $this->connected = false;
        }