summaryrefslogtreecommitdiff
path: root/installer/installer.php
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-09-17 10:02:59 -0700
committerAndy Staudacher <andy.st@gmail.com>2009-09-17 10:02:59 -0700
commit7c8e904388952c9331552bec9a728d732149eabb (patch)
tree2a5152dfcca8fafc111cda9d1e2b0a72ccd24852 /installer/installer.php
parent88c374dee8b63957b7523850508c9bd7b8c4f100 (diff)
parent86681eebf7ee2bf28b12fd12ee6a5fe70bc36d0a (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'installer/installer.php')
-rw-r--r--installer/installer.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/installer/installer.php b/installer/installer.php
index 7a417634..70afc440 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -178,4 +178,45 @@ class installer {
static function prepend_prefix($prefix, $sql) {
return preg_replace("#{([a-zA-Z0-9_]+)}#", "{$prefix}$1", $sql);
}
+
+ static 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 <a href=\"http://php.net/mysql\">MySQL</a> or the <a href=\"http://php.net/mysqli\">MySQLi</a> extension.";
+ }
+
+ if (!@preg_match("/^.$/u", utf8_encode("\xF1"))) {
+ $errors[] = "PHP is missing <a href=\"http://php.net/pcre\">Perl-Compatible Regular Expression</a> support.";
+ }
+
+ if (!(function_exists("spl_autoload_register"))) {
+ $errors[] = "PHP is missing <a href=\"http://php.net/spl\">Standard PHP Library (SPL)</a> support";
+ }
+
+ if (!(class_exists("ReflectionClass"))) {
+ $errors[] = "PHP is missing <a href=\"http://php.net/reflection\">reflection</a> support";
+ }
+
+ if (!(function_exists("filter_list"))) {
+ $errors[] = "PHP is missing the <a href=\"http://php.net/filter\">filter extension</a>";
+ }
+
+ if (!(extension_loaded("iconv"))) {
+ $errors[] = "PHP is missing the <a href=\"http://php.net/iconv\">iconv extension</a>";
+ }
+
+ if (!(extension_loaded("simplexml"))) {
+ $errors[] = "PHP is missing the <a href=\"http://php.net/simplexml\">SimpleXML extension</a>";
+ }
+
+ if (extension_loaded("mbstring") && (ini_get("mbstring.func_overload") & MB_OVERLOAD_STRING)) {
+ $errors[] = "The <a href=\"http://php.net/mbstring\">mbstring extension</a> is overloading PHP's native string functions. Please disable it.";
+ }
+
+ if (!function_exists("json_encode")) {
+ $errors[] = "PHP is missing the <a href=\"http://php.net/manual/en/book.json.php\">JavaScript Object Notation (JSON) extension</a>. Please install it.";
+ }
+
+ return @$errors;
+}
+
}