r104039 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104038‎ | r104039 | r104040 >
Date:14:33, 23 November 2011
Author:bawolff
Status:ok (Comments)
Tags:
Comment:
Make installer error out if php was compiled without ctype support.

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)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -155,6 +155,7 @@
156156 * (bug 1697) The way to search blocked usernames in block log should be clearer
157157 * (bug 29747) eAccelerator shared memory caching has been removed since it is
158158 now disabled by default and is buggy. APC, XCache and WinCache are not affected.
 159+* Installer now refuses to install if php was not compiled with Ctype support
159160
160161 === API changes in 1.19 ===
161162 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/includes/installer/Installer.php
@@ -107,6 +107,7 @@
108108 'envCheckUploadsDirectory',
109109 'envCheckLibicu',
110110 'envCheckSuhosinMaxValueLength',
 111+ 'envCheckCtype',
111112 );
112113
113114 /**
@@ -1070,6 +1071,13 @@
10711072 }
10721073 }
10731074
 1075+ protected function envCheckCtype() {
 1076+ if ( !function_exists( 'ctype_digit' ) ) {
 1077+ $this->showError( 'config-ctype' );
 1078+ return false;
 1079+ }
 1080+ }
 1081+
10741082 /**
10751083 * Get an array of likely places we can find executables. Check a bunch
10761084 * of known Unix-like defaults, as well as the PATH environment variable
Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -132,6 +132,7 @@
133133 'config-memory-bad' => "'''Warning:''' PHP's <code>memory_limit</code> is $1.
134134 This is probably too low.
135135 The installation may fail!",
 136+ 'config-ctype' => "'''Fatal''': PHP must be compiled with support for the [http://www.php.net/manual/en/ctype.installation.php Ctype extension].",
136137 'config-xcache' => '[http://xcache.lighttpd.net/ XCache] is installed',
137138 'config-apc' => '[http://www.php.net/apc APC] is installed',
138139 'config-wincache' => '[http://www.iis.net/download/WinCacheForPhp WinCache] is installed',
@@ -603,6 +604,7 @@
604605 * $2 is the value to which <code>memory_limit</code> was raised.',
605606 'config-memory-bad' => 'Parameters:
606607 * $1 is the configured <code>memory_limit</code>.',
 608+ 'config-ctype' => 'Message if support for [http://www.php.net/manual/en/ctype.installation.php Ctype] is missing from PHP',
607609 'config-xcache' => 'Message indicates if this program is available',
608610 'config-apc' => 'Message indicates if this program is available',
609611 'config-wincache' => 'Message indicates if this program is available',

Comments

#Comment by Nikerabbit (talk | contribs)   07:49, 24 November 2011

"with support for X" feels redundant compared to just "with X",

#Comment by Hashar (talk | contribs)   17:35, 28 November 2011

no need to reimplements ctype. There is already enough code in MW, people should just have at least the default PHP modules :-)

Status & tagging log