]> git.wh0rd.org - tt-rss.git/blobdiff - install/index.php
remove support for legacy mysql driver
[tt-rss.git] / install / index.php
index bfbb7e23491e72dad4e92e5508214d96bae5bf28..00e90dfe7c8d8db348cfc35d3de9a3f63e7035b5 100755 (executable)
@@ -51,7 +51,7 @@
                        array_push($errors, "PHP support for JSON is required, but was not found.");
                }
 
-               if ($db_type == "mysql" && !function_exists("mysql_connect") && !function_exists("mysqli_connect")) {
+               if ($db_type == "mysql" && !function_exists("mysqli_connect")) {
                        array_push($errors, "PHP support for MySQL is required for configured $db_type in config.php.");
                }
 
                        return $link;
 
                } else if ($type == "mysql") {
-                       if (function_exists("mysqli_connect")) {
-                               if ($port)
-                                       return mysqli_connect($host, $user, $pass, $db, $port);
-                               else
-                                       return mysqli_connect($host, $user, $pass, $db);
-
-                       } else {
-                               $link = mysql_connect($host, $user, $pass);
-                               if ($link) {
-                                       $result = mysql_select_db($db, $link);
-                                       if ($result) return $link;
-                               }
-                       }
+                       if ($port)
+                               return mysqli_connect($host, $user, $pass, $db, $port);
+                       else
+                               return mysqli_connect($host, $user, $pass, $db);
                }
        }
 
                        return $result;
                } else if ($type == "mysql") {
 
-                       if (function_exists("mysqli_connect")) {
-                               $result = mysqli_query($link, $query);
-                       } else {
-                               $result = mysql_query($query, $link);
-                       }
+                       $result = mysqli_query($link, $query);
+
                        if (!$result) {
                                $query = htmlspecialchars($query);
                                if ($die_on_error) {
-                                       die("Query <i>$query</i> failed: " . ($link ? function_exists("mysqli_connect") ? mysqli_error($link) : mysql_error($link) : "No connection"));
+                                       die("Query <i>$query</i> failed: " . ($link ? mysqli_error($link) : "No connection"));
                                }
                        }
                        return $result;