summaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-22 19:51:52 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-22 19:51:52 +0000
commitc33ac93b2b4c82c502898eb5f8afe3197c456af6 (patch)
tree3062f36998ff14edc626ee0b7a96b39236e52692 /installer
parentebfc7d4f4753f65cdfdd98d91b8eaf9db7a9ed94 (diff)
Require mysqli_set_charset to use the mysqli extension
Diffstat (limited to 'installer')
-rw-r--r--installer/cli.php2
-rw-r--r--installer/web.php8
2 files changed, 3 insertions, 7 deletions
diff --git a/installer/cli.php b/installer/cli.php
index 44ba1e47..93d4d502 100644
--- a/installer/cli.php
+++ b/installer/cli.php
@@ -73,7 +73,7 @@ function parse_cli_params() {
"password" => "",
"dbname" => "gallery3",
"prefix" => "",
- "type" => function_exists("mysqli_init") ? "mysqli" : "mysql");
+ "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql");
$argv = $_SERVER["argv"];
for ($i = 1; $i < count($argv); $i++) {
diff --git a/installer/web.php b/installer/web.php
index 33012a79..89b0021d 100644
--- a/installer/web.php
+++ b/installer/web.php
@@ -37,7 +37,7 @@ if (installer::already_installed()) {
"password" => $_POST["dbpass"],
"dbname" => $_POST["dbname"],
"prefix" => "",
- "type" => function_exists("mysqli_init") ? "mysqli" : "mysql");
+ "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql");
if (!installer::connect($config)) {
$content = render("invalid_db_info.html.php");
@@ -73,11 +73,7 @@ function oops($error) {
}
function check_environment() {
- if (version_compare(PHP_VERSION, "5.2.3", "<")) {
- $errors[] = "Gallery 3 requires PHP 5.2.3 or newer, current version: " . PHP_VERSION;
- }
-
- if (!function_exists("mysql_query") && !function_exists("mysqli_init")) {
+ if (!function_exists("mysql_query") && !function_exists("mysqli_set_charset")) {
$errors[] = "Gallery 3 requires a MySQL database, but PHP doesn't have either the the <a href=\"http://php.net/mysql\">MySQL</a> or the <a href=\"http://php.net/mysqli\">MySQLi</a> extension.";
}