Make installer error out if php was compiled without ctype support.
authorBrian Wolff <bawolff@users.mediawiki.org>
Wed, 23 Nov 2011 14:33:33 +0000 (14:33 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Wed, 23 Nov 2011 14:33:33 +0000 (14:33 +0000)
This is probably very few people, because you have to actively disable ctype support in order for it not to be compilied in to php. However, there was thread in support desk recently about this ( http://www.mediawiki.org/wiki/Thread:Project:Support_desk/Blank_page_after_install )

(I suppose we could implement work around functions in the case ctype was missing, but doesn't really seem worth it given that its enabled by default, so almost no one will be missing it)

RELEASE-NOTES-1.19
includes/installer/Installer.i18n.php
includes/installer/Installer.php

index a7c7542..11e87d0 100644 (file)
@@ -155,6 +155,7 @@ production.
 * (bug 1697) The way to search blocked usernames in block log should be clearer
 * (bug 29747) eAccelerator shared memory caching has been removed since it is
   now disabled by default and is buggy. APC, XCache and WinCache are not affected.
+* Installer now refuses to install if php was not compiled with Ctype support
 
 === API changes in 1.19 ===
 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
index 955f393..0e29f33 100644 (file)
@@ -132,6 +132,7 @@ MediaWiki requires UTF-8 support to function correctly.",
        'config-memory-bad'               => "'''Warning:''' PHP's <code>memory_limit</code> is $1.
 This is probably too low.
 The installation may fail!",
+       'config-ctype'                    => "'''Fatal''': PHP must be compiled with support for the [http://www.php.net/manual/en/ctype.installation.php Ctype extension].",
        'config-xcache'                   => '[http://xcache.lighttpd.net/ XCache] is installed',
        'config-apc'                      => '[http://www.php.net/apc APC] is installed',
        'config-wincache'                 => '[http://www.iis.net/download/WinCacheForPhp WinCache] is installed',
@@ -603,6 +604,7 @@ Parameters:
 * $2 is the value to which <code>memory_limit</code> was raised.',
        'config-memory-bad' => 'Parameters:
 * $1 is the configured <code>memory_limit</code>.',
+       'config-ctype' => 'Message if support for [http://www.php.net/manual/en/ctype.installation.php Ctype] is missing from PHP',
        'config-xcache' => 'Message indicates if this program is available',
        'config-apc' => 'Message indicates if this program is available',
        'config-wincache' => 'Message indicates if this program is available',
index 3e8a88b..b0b40fc 100644 (file)
@@ -107,6 +107,7 @@ abstract class Installer {
                'envCheckUploadsDirectory',
                'envCheckLibicu',
                'envCheckSuhosinMaxValueLength',
+               'envCheckCtype',
        );
 
        /**
@@ -1070,6 +1071,13 @@ abstract class Installer {
                }
        }
 
+       protected function envCheckCtype() {
+               if ( !function_exists( 'ctype_digit' ) ) {
+                       $this->showError( 'config-ctype' );
+                       return false;
+               }
+       }
+
        /**
         * Get an array of likely places we can find executables. Check a bunch
         * of known Unix-like defaults, as well as the PATH environment variable