[-] Installer: check create table privileges

This commit is contained in:
Rémi Gaillard
2013-02-01 18:36:35 +01:00
parent 6a261cbc66
commit 5490f6063d
5 changed files with 74 additions and 0 deletions

View File

@@ -185,6 +185,25 @@ class DbMySQLiCore extends Db
$link->close();
return 0;
}
public static function checkCreatePrivilege($server, $user, $pwd, $db, $prefix, $engine)
{
$link = @new mysqli($server, $user, $pwd, $db);
if (mysqli_connect_error())
return false;
$sql = '
CREATE TABLE `'.$prefix.'test` (
`test` tinyint(1) unsigned NOT NULL
) ENGINE=MyISAM';
$result = $link->query($sql);
if (!$result)
return $link->error;
$link->query('DROP TABLE `'.$prefix.'test`');
return true;
}
/**
* @see Db::checkEncoding()