]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/Database.php
Merge pull request #11282 from annando/api-fix
[friendica.git] / src / Database / Database.php
index b5aed6c18a5f70f05444c31c0a55e4b0d4be92c7..88d8d7d0f6ef87baa78cbc7f63dcd2cceeb65c15 100644 (file)
@@ -135,12 +135,12 @@ class Database
                        if ($charset) {
                                $connect .= ";charset=" . $charset;
                        }
-                       
-                        if ($socket) {
-                                $connect .= ";$unix_socket=" . $socket;
-                        }
-                       
-                        try {
+
+                       if ($socket) {
+                               $connect .= ";$unix_socket=" . $socket;
+                       }
+
+                       try {
                                $this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]);
                                $this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->pdo_emulate_prepares);
                                $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
@@ -165,10 +165,10 @@ class Database
                                if ($charset) {
                                        $this->connection->set_charset($charset);
                                }
-                                
-                                if ($socket) {
-                                        $this->connection->set_socket($socket);
-                                }
+
+                               if ($socket) {
+                                       $this->connection->set_socket($socket);
+                               }
 
                        }
                }