diff --git a/install.php b/install.php index 12e7b263..fdddfa30 100644 --- a/install.php +++ b/install.php @@ -134,20 +134,21 @@ function ask_questions() { // {{{ "; } + $drivers = PDO::getAvailableDrivers(); if( - !function_exists("mysql_connect") && - !function_exists("pg_connect") && - !function_exists("sqlite_open") + !in_array("mysql", $drivers) && + !in_array("pgsql", $drivers) && + !in_array("sqlite", $drivers) ) { $errors[] = " No database connection library could be found; shimmie needs - php-pgsql, php-mysql, or php-sqlite + PDO with either Postgres, MySQL, or SQLite drivers "; } - $db_m = function_exists("mysql_connect") ? '' : ""; - $db_p = function_exists("pg_connect") ? '' : ""; - $db_s = function_exists("sqlite_open") ? '' : ""; + $db_m = in_array("mysql", $drivers) ? '' : ""; + $db_p = in_array("pgsql", $drivers) ? '' : ""; + $db_s = in_array("sqlite", $drivers) ? '' : ""; $warn_msg = $warnings ? "

Warnings

".implode("\n
", $warnings) : ""; $err_msg = $errors ? "

Errors

".implode("\n
", $errors) : "";