From 86681eebf7ee2bf28b12fd12ee6a5fe70bc36d0a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Sep 2009 07:29:37 -0700 Subject: Move the check_environment into the installer helper and call it from the command line installer as well as the web installer. --- installer/web.php | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'installer/web.php') diff --git a/installer/web.php b/installer/web.php index eb0211a6..c46f072a 100644 --- a/installer/web.php +++ b/installer/web.php @@ -23,7 +23,7 @@ if (installer::already_installed()) { switch (@$_GET["step"]) { default: case "welcome": - $errors = check_environment(); + $errors = installer::check_environment(); if ($errors) { $content = render("environment_errors.html.php", array("errors" => $errors)); } else { @@ -80,43 +80,3 @@ function render($view, $args=array()) { function oops($error) { return render("oops.html.php", array("error" => $error)); } - -function check_environment() { - if (!function_exists("mysql_query") && !function_exists("mysqli_set_charset")) { - $errors[] = "Gallery 3 requires a MySQL database, but PHP doesn't have either the MySQL or the MySQLi extension."; - } - - if (!@preg_match("/^.$/u", utf8_encode("\xF1"))) { - $errors[] = "PHP is missing Perl-Compatible Regular Expression support."; - } - - if (!(function_exists("spl_autoload_register"))) { - $errors[] = "PHP is missing Standard PHP Library (SPL) support"; - } - - if (!(class_exists("ReflectionClass"))) { - $errors[] = "PHP is missing reflection support"; - } - - if (!(function_exists("filter_list"))) { - $errors[] = "PHP is missing the filter extension"; - } - - if (!(extension_loaded("iconv"))) { - $errors[] = "PHP is missing the iconv extension"; - } - - if (!(extension_loaded("simplexml"))) { - $errors[] = "PHP is missing the SimpleXML extension"; - } - - if (extension_loaded("mbstring") && (ini_get("mbstring.func_overload") & MB_OVERLOAD_STRING)) { - $errors[] = "The mbstring extension is overloading PHP's native string functions. Please disable it."; - } - - if (!function_exists("json_encode")) { - $errors[] = "PHP is missing the JavaScript Object Notation (JSON) extension. Please install it."; - } - - return @$errors; -} -- cgit v1.2.3