diff options
author | Brion Vibber <brion@pobox.com> | 2010-04-20 13:52:58 +0200 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-04-20 13:52:58 +0200 |
commit | df41287226d113f178ef66f320c8568566890fe9 (patch) | |
tree | 26cc4094f89dd76c1d95584c729ec4c32072610a /lib/installer.php | |
parent | 056cce4b5eed28751bbad97e0dc826ee5310ff39 (diff) | |
parent | 61098faf5dd2685ea00c110bb4a3c871da17a300 (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/installer.php')
-rw-r--r-- | lib/installer.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/installer.php b/lib/installer.php index d0e46f95c..589a19a66 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -51,7 +51,7 @@ abstract class Installer public static $dbModules = array( 'mysql' => array( 'name' => 'MySQL', - 'check_module' => 'mysql', // mysqli? + 'check_module' => 'mysqli', 'installer' => 'mysql_db_installer', ), 'pgsql' => array( @@ -341,7 +341,6 @@ abstract class Installer * @param string $password * @return mixed array of database connection params on success, false on failure * - * @fixme be consistent about using mysqli vs mysql! * @fixme escape things in the connection string in case we have a funny pass etc */ function Mysql_Db_installer($host, $database, $username, $password) @@ -349,14 +348,13 @@ abstract class Installer $this->updateStatus("Starting installation..."); $this->updateStatus("Checking database..."); - $conn = mysql_connect($host, $username, $password); - if (!$conn) { + $conn = mysqli_init(); + if (!$conn->real_connect($host, $username, $password)) { $this->updateStatus("Can't connect to server '$host' as '$username'.", true); return false; } $this->updateStatus("Changing to database..."); - $res = mysql_select_db($database, $conn); - if (!$res) { + if (!$conn->select_db($database)) { $this->updateStatus("Can't change to database.", true); return false; } @@ -438,9 +436,9 @@ abstract class Installer // FIXME: use PEAR::DB or PDO instead of our own switch switch ($type) { case 'mysqli': - $res = mysql_query($stmt, $conn); + $res = $conn->query($stmt); if ($res === false) { - $error = mysql_error(); + $error = $conn->error(); } break; case 'pgsql': |