diff options
Diffstat (limited to 'installer')
-rw-r--r-- | installer/check.html.php | 92 | ||||
-rw-r--r-- | installer/index.php | 6 | ||||
-rw-r--r-- | installer/install.css | 21 | ||||
-rw-r--r-- | installer/install.html.php | 30 | ||||
-rw-r--r-- | installer/installer.php | 49 |
5 files changed, 124 insertions, 74 deletions
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 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<html> + <head> + <title>Gallery3 Installer: System Checks</title> + <link rel="stylesheet" type="text/css" href="install.css"/> + </head> + <body> + <div id="outer"> + <div id="inner"> + <img width="300" height="178" src="../core/images/gallery2.png"/> + + <h1> System Checks </h1> + <?php if (installer::already_installed()): ?> + <p> + 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. + </p> + <?php else: ?> + + <?php ob_start() ?> + <ul class="errors"> + <?php if (version_compare(PHP_VERSION, "5.2", "<")): ?> + <li> + Gallery 3 requires PHP 5.2 or newer, current version: <?= PHP_VERSION ?> + </li> + <?php $fail++; endif ?> + + <?php if (!function_exists("mysql_query") && !function_exists("mysqli_init")): ?> + <li> + 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. + </li> + <?php $fail++; endif ?> + + <?php if (!@preg_match("/^.$/u", utf8_encode("\xF1"))): ?> + <li> + PHP is missing <a href="http://php.net/pcre">Perl-Compatible Regular Expression</a> support. + </li> + <?php $fail++; endif ?> + + <?php if (!(class_exists("ReflectionClass"))): ?> + <li> + PHP is missing <a href="http://php.net/reflection">reflection</a> support + </li> + <?php $fail++; endif ?> + + <?php if (!(function_exists("filter_list"))): ?> + <li> + PHP is missing the <a href="http://php.net/filter">filter extension</a> + </li> + <?php $fail++; endif ?> + + <?php if (!(extension_loaded("iconv"))): ?> + <li> + PHP is missing the <a href="http://php.net/iconv">iconv extension</a> + </li> + <?php $fail++; endif ?> + + <?php if (extension_loaded("mbstring") && (ini_get("mbstring.func_overload") & MB_OVERLOAD_STRING)): ?> + <li> + The <a href="http://php.net/mbstring">mbstring + extension</a> is overloading PHP's native string + functions. Please disable it. + </li> + <?php endif ?> + </ul> + <?php $errors = ob_get_clean() ?> + + <?php if (!empty($fail)): ?> + <p> + There are some problems with your web hosting environment + that need to be fixed before you can successfully install + Gallery 3. + </p> + <?php echo $errors ?> + <p> + <a href="check.php">Check again</a> + </p> + + <?php else: ?> + <p> + Good news! We've checked everything we can think of and it + looks like Gallery 3 should work just fine on your system. + </p> + <? endif ?> + <? endif /* already_installed check */?> + </div> + </div> + </body> +</html> 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 @@ <html> <head> <title>Gallery3 Installer</title> - <style> - 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; - height: 400px; - } - - h1, h2, h3 { - margin-bottom: .1em; - } - </style> + <link rel="stylesheet" type="text/css" href="install.css"/> </head> <body> <div id="outer"> @@ -80,6 +57,11 @@ <?php endif ?> </div> <p> + Did something go wrong? Run + a <a href="index.php?page=check">system check</a> to make sure + that it's not an issue with your web host. + </p> + <p> Questions or problems? Visit the <a href="http://gallery.menalto.com">Gallery Website</a>. </p> </div> 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", |