From d51955c8efa78d7f0a0ca8c138c2eebaf5ecb975 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 19 Jan 2009 20:20:10 +0000 Subject: Pull the environment check out into a separate web page to simplify the CLI installer. Put a link to it in the footer of every web install page. Don't allow users to run it if Gallery 3 is already installed. --- installer/check.html.php | 92 ++++++++++++++++++++++++++++++++++++++++++++++ installer/index.php | 6 ++- installer/install.css | 21 +++++++++++ installer/install.html.php | 30 +++------------ installer/installer.php | 49 ------------------------ 5 files changed, 124 insertions(+), 74 deletions(-) create mode 100644 installer/check.html.php create mode 100644 installer/install.css diff --git a/installer/check.html.php b/installer/check.html.php new file mode 100644 index 00000000..34d0b3cb --- /dev/null +++ b/installer/check.html.php @@ -0,0 +1,92 @@ + + + + Gallery3 Installer: System Checks + + + +
+
+ + +

System Checks

+ +

+ As a privacy measure, we do not allow you to run the system + check page after your Gallery has been installed. This + keeps prying eyes from learning about your system. +

+ + + + + + + +

+ There are some problems with your web hosting environment + that need to be fixed before you can successfully install + Gallery 3. +

+ +

+ Check again +

+ + +

+ Good news! We've checked everything we can think of and it + looks like Gallery 3 should work just fine on your system. +

+ + +
+
+ + diff --git a/installer/index.php b/installer/index.php index 19b99735..90beb4f9 100644 --- a/installer/index.php +++ b/installer/index.php @@ -34,6 +34,10 @@ require(DOCROOT . "installer/installer.php"); if (php_sapi_name() == "cli") { installer::command_line(); } else { - installer::web(); + if ($_GET["page"] == "check") { + include("check.html.php"); + } else { + installer::web(); + } } diff --git a/installer/install.css b/installer/install.css new file mode 100644 index 00000000..36f7f321 --- /dev/null +++ b/installer/install.css @@ -0,0 +1,21 @@ +body { + background: #eee; + font-family: Trebuchet MS; +} + +div#outer { + width: 650px; + background: white; + border: 1px solid #999; + margin: 0 auto; + padding: -10px; +} + +div#inner { + padding: 0 1em 0 1em; + margin: 0px; +} + +h1, h2, h3 { + margin-bottom: .1em; +} diff --git a/installer/install.html.php b/installer/install.html.php index 281166d9..04870b7a 100644 --- a/installer/install.html.php +++ b/installer/install.html.php @@ -2,30 +2,7 @@ Gallery3 Installer - +
@@ -79,6 +56,11 @@
+

+ Did something go wrong? Run + a system check to make sure + that it's not an issue with your web host. +

Questions or problems? Visit the Gallery Website.

diff --git a/installer/installer.php b/installer/installer.php index 72225ef0..2da3cd02 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -31,7 +31,6 @@ class installer { $config = self::parse_cli_params(); try { - self::environment_check(); self::setup_database($config); self::setup_var(); self::install($config); @@ -83,54 +82,6 @@ class installer { return file_exists(VARPATH . "database.php"); } - static function environment_check() { - $errors = array(); - - if (version_compare(PHP_VERSION, "5.2", "<")) { - $errors["PHP Version"] = sprintf( - "Gallery3 requires PHP 5.2 or newer, current version: %s.", PHP_VERSION); - } - - if (!@preg_match("/^.$/u", utf8_encode("\xF1"))) { - $errors["PCRE UTF-8"] = - "PHP is missing Perl-Compatible Regular Expression support (http://php.net/pcre)"; - } - - if (!(class_exists("ReflectionClass"))) { - $errors["PHP Reflection"] = "PHP is missing Reflection support (http://php.net/reflection)"; - } - - if (!(function_exists("filter_list"))) { - $errors["Filters"] = "PHP is missing the filter extension (http://php.net/filter)"; - } - - if (!(extension_loaded("iconv"))) { - $errors["iconv"] = "PHP is missing the iconv extension (http://php.net/iconv)"; - } - - if (extension_loaded("mbstring") && - (ini_get("mbstring.func_overload") & MB_OVERLOAD_STRING)) { - $errors["Multibyte Strings"] = - "The mbstring extension is overloading PHP's native string functions " . - "(http://php.net/mbstring)"; - } - - if (!(isset($_SERVER["REQUEST_URI"]) || isset($_SERVER["PHP_SELF"]))) { - $errors["URL Detection"] = - "Neither \$_SERVER['REQUEST_URI'] or \$_SERVER['PHP_SELF'] is available"; - } - - $short_tags = ini_get("short_open_tag"); - if (empty($short_tags)) { - $errors["Short Tags"] = - "PHP short tag support is disabled. (http://php.net/manual/en/ini.core.php)"; - } - - if ($errors) { - throw new InstallException($errors); - } - } - static function parse_cli_params() { $config = array("host" => "localhost", "user" => "root", -- cgit v1.2.3