Index: trunk/phase3/maintenance/mcc.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | $showhelp = false; |
48 | 48 | $quit = false; |
49 | 49 | |
50 | | - $line = readconsole( '> ' ); |
| 50 | + $line = Maintenance::readconsole(); |
51 | 51 | if ( $line === false ) exit; |
52 | 52 | |
53 | 53 | $args = explode( ' ', $line ); |
Index: trunk/phase3/maintenance/update.php |
— | — | @@ -35,6 +35,30 @@ |
36 | 36 | return 2 /* Maintenance::DB_ADMIN */; |
37 | 37 | } |
38 | 38 | |
| 39 | + private function compatChecks() { |
| 40 | + $test = new PhpXmlBugTester(); |
| 41 | + if ( !$test->ok ) { |
| 42 | + $this->error( |
| 43 | + "Your system has a combination of PHP and libxml2 versions which is buggy\n" . |
| 44 | + "and can cause hidden data corruption in MediaWiki and other web apps.\n" . |
| 45 | + "Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later!\n" . |
| 46 | + "ABORTING (see http://bugs.php.net/bug.php?id=45996).\n", |
| 47 | + true ); |
| 48 | + } |
| 49 | + |
| 50 | + $test = new PhpRefCallBugTester; |
| 51 | + $test->execute(); |
| 52 | + if ( !$test->ok ) { |
| 53 | + $ver = phpversion(); |
| 54 | + $this->error( |
| 55 | + "PHP $ver is not compatible with MediaWiki due to a bug involving\n" . |
| 56 | + "reference parameters to __call. Upgrade to PHP 5.3.2 or higher, or \n" . |
| 57 | + "downgrade to PHP 5.3.0 to fix this.\n" . |
| 58 | + "ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n", |
| 59 | + true ); |
| 60 | + } |
| 61 | + } |
| 62 | + |
39 | 63 | function execute() { |
40 | 64 | global $wgVersion, $wgTitle, $wgLang; |
41 | 65 | |
— | — | @@ -44,7 +68,7 @@ |
45 | 69 | $this->output( "MediaWiki {$wgVersion} Updater\n\n" ); |
46 | 70 | |
47 | 71 | if ( !$this->hasOption( 'skip-compat-checks' ) ) { |
48 | | - install_version_checks(); |
| 72 | + $this->compatChecks(); |
49 | 73 | } else { |
50 | 74 | $this->output( "Skipping compatibility checks, proceed at your own risk (Ctrl+C to abort)\n" ); |
51 | 75 | wfCountdown( 5 ); |
Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -18,6 +18,15 @@ |
19 | 19 | "administrator.\n" ); |
20 | 20 | } |
21 | 21 | |
| 22 | +// Wrapper for posix_isatty() |
| 23 | +if ( !function_exists( 'posix_isatty' ) ) { |
| 24 | + # We default as considering stdin a tty (for nice readline methods) |
| 25 | + # but treating stout as not a tty to avoid color codes |
| 26 | + function posix_isatty( $fd ) { |
| 27 | + return !$fd; |
| 28 | + } |
| 29 | +} |
| 30 | + |
22 | 31 | /** |
23 | 32 | * Abstract maintenance class for quickly writing and churning out |
24 | 33 | * maintenance scripts with minimal effort. All that _must_ be defined |
— | — | @@ -1044,6 +1053,72 @@ |
1045 | 1054 | return $title; |
1046 | 1055 | } |
1047 | 1056 | |
| 1057 | + /** |
| 1058 | + * Prompt the console for input |
| 1059 | + * @param $prompt String what to begin the line with, like '> ' |
| 1060 | + * @return String response |
| 1061 | + */ |
| 1062 | + public static function readconsole( $prompt = '> ' ) { |
| 1063 | + static $isatty = null; |
| 1064 | + if ( is_null( $isatty ) ) { |
| 1065 | + if ( posix_isatty( 0 /*STDIN*/ ) ) { |
| 1066 | + $isatty = true; |
| 1067 | + } else { |
| 1068 | + $isatty = false; |
| 1069 | + } |
| 1070 | + } |
| 1071 | + |
| 1072 | + if ( $isatty && function_exists( 'readline' ) ) { |
| 1073 | + return readline( $prompt ); |
| 1074 | + } else { |
| 1075 | + if ( $isatty ) { |
| 1076 | + $st = readlineEmulation( $prompt ); |
| 1077 | + } else { |
| 1078 | + if ( feof( STDIN ) ) { |
| 1079 | + $st = false; |
| 1080 | + } else { |
| 1081 | + $st = fgets( STDIN, 1024 ); |
| 1082 | + } |
| 1083 | + } |
| 1084 | + if ( $st === false ) return false; |
| 1085 | + $resp = trim( $st ); |
| 1086 | + return $resp; |
| 1087 | + } |
| 1088 | + } |
| 1089 | + |
| 1090 | + /** |
| 1091 | + * Emulate readline() |
| 1092 | + * @param $prompt String what to begin the line with, like '> ' |
| 1093 | + * @return String |
| 1094 | + */ |
| 1095 | + private static function readlineEmulation( $prompt ) { |
| 1096 | + $bash = array( 'bash' ); |
| 1097 | + if ( !wfIsWindows() && Installer::locateExecutableInDefaultPaths( $bash ) ) { |
| 1098 | + $retval = false; |
| 1099 | + $encPrompt = wfEscapeShellArg( $prompt ); |
| 1100 | + $command = "read -er -p $encPrompt && echo \"\$REPLY\""; |
| 1101 | + $encCommand = wfEscapeShellArg( $command ); |
| 1102 | + $line = wfShellExec( "$bash -c $encCommand", $retval ); |
| 1103 | + |
| 1104 | + if ( $retval == 0 ) { |
| 1105 | + return $line; |
| 1106 | + } elseif ( $retval == 127 ) { |
| 1107 | + // Couldn't execute bash even though we thought we saw it. |
| 1108 | + // Shell probably spit out an error message, sorry :( |
| 1109 | + // Fall through to fgets()... |
| 1110 | + } else { |
| 1111 | + // EOF/ctrl+D |
| 1112 | + return false; |
| 1113 | + } |
| 1114 | + } |
| 1115 | + |
| 1116 | + // Fallback... we'll have no editing controls, EWWW |
| 1117 | + if ( feof( STDIN ) ) { |
| 1118 | + return false; |
| 1119 | + } |
| 1120 | + print $prompt; |
| 1121 | + return fgets( STDIN, 1024 ); |
| 1122 | + } |
1048 | 1123 | } |
1049 | 1124 | |
1050 | 1125 | class FakeMaintenance extends Maintenance { |
Index: trunk/phase3/maintenance/install-utils.inc |
— | — | @@ -1,182 +1,14 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | | - * This file contains functions used by the install script (config/index.php) |
6 | | - * and maintenance scripts. It is not loaded in normal web requests. |
| 4 | + * This file contains ancient db-related functions that have been deprecated. Do |
| 5 | + * not use them. Please find the appropriate replacements. |
7 | 6 | * |
8 | 7 | * @file |
9 | 8 | */ |
10 | 9 | |
11 | | -function install_version_checks() { |
12 | | - # We dare not turn output buffer _off_ since this will break completely |
13 | | - # if PHP is globally configured to run through a gzip filter. |
14 | | - @ob_implicit_flush( true ); |
15 | | - |
16 | | - if ( !function_exists( 'version_compare' ) ) { |
17 | | - # version_compare was introduced in 4.1.0 |
18 | | - echo "Your PHP version is much too old; 4.0.x will _not_ work. 5.1.0 or higher is required. ABORTING.\n"; |
19 | | - die( 1 ); |
20 | | - } |
21 | | - if ( version_compare( phpversion(), '5.1.0' ) < 0 ) { |
22 | | - echo "PHP 5.1.0 or higher is required. If PHP 5 is available only when \n" . |
23 | | - "PHP files have a .php5 extension, please navigate to <a href=\"index.php5\">index.php5</a> \n" . |
24 | | - "to continue installation. ABORTING.\n"; |
25 | | - die( 1 ); |
26 | | - } |
27 | | - |
28 | | - $test = new PhpXmlBugTester(); |
29 | | - if ( !$test->ok ) { |
30 | | - echo "Your system has a combination of PHP and libxml2 versions which is buggy\n" . |
31 | | - "and can cause hidden data corruption in MediaWiki and other web apps.\n" . |
32 | | - "Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later!\n" . |
33 | | - "ABORTING (http://bugs.php.net/bug.php?id=45996 for details).\n"; |
34 | | - die( 1 ); |
35 | | - } |
36 | | - |
37 | | - $test = new PhpRefCallBugTester; |
38 | | - $test->execute(); |
39 | | - if ( !$test->ok ) { |
40 | | - echo "PHP 5.3.1 is not compatible with MediaWiki due to a bug involving\n" . |
41 | | - "reference parameters to __call. Upgrade to PHP 5.3.2 or higher, or \n" . |
42 | | - "downgrade to PHP 5.3.0 to fix this.\n" . |
43 | | - "ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n"; |
44 | | - die( 1 ); |
45 | | - } |
46 | | - |
47 | | - global $wgCommandLineMode; |
48 | | - $wgCommandLineMode = true; |
49 | | - umask( 000 ); |
50 | | - @set_time_limit( 0 ); |
51 | | -} |
52 | | - |
53 | 10 | /** |
54 | | - * Test for PHP+libxml2 bug which breaks XML input subtly with certain versions. |
55 | | - * http://bugs.php.net/bug.php?id=45996 |
56 | | - * Known fixed with PHP 5.2.9 + libxml2-2.7.3 |
| 11 | + * @deprecated Use DatabaseBase::sourceFile(). Will probably be removed in 1.19 |
57 | 12 | */ |
58 | | -class PhpXmlBugTester { |
59 | | - private $parsedData = ''; |
60 | | - public $ok = false; |
61 | | - public function __construct() { |
62 | | - $charData = '<b>c</b>'; |
63 | | - $xml = '<a>' . htmlspecialchars( $charData ) . '</a>'; |
64 | | - |
65 | | - $parser = xml_parser_create(); |
66 | | - xml_set_character_data_handler( $parser, array( $this, 'chardata' ) ); |
67 | | - $parsedOk = xml_parse( $parser, $xml, true ); |
68 | | - $this->ok = $parsedOk && ( $this->parsedData == $charData ); |
69 | | - } |
70 | | - public function chardata( $parser, $data ) { |
71 | | - $this->parsedData .= $data; |
72 | | - } |
73 | | -} |
74 | | - |
75 | | -/** |
76 | | - * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x) |
77 | | - */ |
78 | | -class PhpRefCallBugTester { |
79 | | - public $ok = false; |
80 | | - |
81 | | - function __call( $name, $args ) { |
82 | | - $old = error_reporting( E_ALL & ~E_WARNING ); |
83 | | - call_user_func_array( array( $this, 'checkForBrokenRef' ), $args ); |
84 | | - error_reporting( $old ); |
85 | | - } |
86 | | - |
87 | | - function checkForBrokenRef( &$var ) { |
88 | | - if ( $var ) { |
89 | | - $this->ok = true; |
90 | | - } |
91 | | - } |
92 | | - |
93 | | - function execute() { |
94 | | - $var = true; |
95 | | - call_user_func_array( array( $this, 'foo' ), array( &$var ) ); |
96 | | - } |
97 | | -} |
98 | | - |
99 | | -if ( !function_exists( 'posix_isatty' ) ) { |
100 | | - # We default as considering stdin a tty (for nice readline methods) |
101 | | - # but treating stout as not a tty to avoid color codes |
102 | | - function posix_isatty( $fd ) { |
103 | | - return !$fd; |
104 | | - } |
105 | | -} |
106 | | - |
107 | | -function readconsole( $prompt = '' ) { |
108 | | - static $isatty = null; |
109 | | - if ( is_null( $isatty ) ) { |
110 | | - if ( posix_isatty( 0 /*STDIN*/ ) ) { |
111 | | - $isatty = true; |
112 | | - } else { |
113 | | - $isatty = false; |
114 | | - } |
115 | | - } |
116 | | - |
117 | | - if ( $isatty && function_exists( 'readline' ) ) { |
118 | | - return readline( $prompt ); |
119 | | - } else { |
120 | | - if ( $isatty ) { |
121 | | - $st = readlineEmulation( $prompt ); |
122 | | - } else { |
123 | | - if ( feof( STDIN ) ) { |
124 | | - $st = false; |
125 | | - } else { |
126 | | - $st = fgets( STDIN, 1024 ); |
127 | | - } |
128 | | - } |
129 | | - if ( $st === false ) return false; |
130 | | - $resp = trim( $st ); |
131 | | - return $resp; |
132 | | - } |
133 | | -} |
134 | | - |
135 | | -function findExecutable( $name ) { |
136 | | - $paths = explode( PATH_SEPARATOR, getenv( "PATH" ) ); |
137 | | - foreach ( $paths as $path ) { |
138 | | - $full = $path . DIRECTORY_SEPARATOR . $name; |
139 | | - if ( file_exists( $full ) ) { |
140 | | - if ( wfIsWindows() || is_executable( $full ) ) { |
141 | | - return $full; |
142 | | - } |
143 | | - } |
144 | | - } |
145 | | - return false; |
146 | | -} |
147 | | - |
148 | | -function readlineEmulation( $prompt ) { |
149 | | - $bash = "bash"; |
150 | | - if ( !wfIsWindows() && findExecutable( $bash ) ) { |
151 | | - $retval = false; |
152 | | - $encPrompt = wfEscapeShellArg( $prompt ); |
153 | | - $command = "read -er -p $encPrompt && echo \"\$REPLY\""; |
154 | | - $encCommand = wfEscapeShellArg( $command ); |
155 | | - $line = wfShellExec( "$bash -c $encCommand", $retval ); |
156 | | - |
157 | | - if ( $retval == 0 ) { |
158 | | - return $line; |
159 | | - } elseif ( $retval == 127 ) { |
160 | | - // Couldn't execute bash even though we thought we saw it. |
161 | | - // Shell probably spit out an error message, sorry :( |
162 | | - // Fall through to fgets()... |
163 | | - } else { |
164 | | - // EOF/ctrl+D |
165 | | - return false; |
166 | | - } |
167 | | - } |
168 | | - |
169 | | - // Fallback... we'll have no editing controls, EWWW |
170 | | - if ( feof( STDIN ) ) { |
171 | | - return false; |
172 | | - } |
173 | | - print $prompt; |
174 | | - return fgets( STDIN, 1024 ); |
175 | | -} |
176 | | - |
177 | | - |
178 | | -# |
179 | | -# Read and execute SQL commands from a file |
180 | | -# |
181 | 13 | function dbsource( $fname, $db = false ) { |
182 | 14 | wfDeprecated( __METHOD__ ); |
183 | 15 | if ( !$db ) { |
— | — | @@ -189,38 +21,11 @@ |
190 | 22 | } |
191 | 23 | } |
192 | 24 | |
| 25 | +/** |
| 26 | + * @deprecated Use DatabaseBase::patchPath(). Will probably be removed in 1.18 |
| 27 | + */ |
193 | 28 | function archive( $name ) { |
194 | 29 | wfDeprecated( __METHOD__ ); |
195 | 30 | $dbr = wfGetDB( DB_SLAVE ); |
196 | 31 | return $dbr->patchPath( $name ); |
197 | 32 | } |
198 | | - |
199 | | -/** |
200 | | - * Get the value of session.save_path |
201 | | - * |
202 | | - * Per http://www.php.net/manual/en/ref.session.php#ini.session.save-path, |
203 | | - * this might have some additional preceding parts which need to be |
204 | | - * ditched |
205 | | - * |
206 | | - * @return string |
207 | | - */ |
208 | | -function mw_get_session_save_path() { |
209 | | - $path = ini_get( 'session.save_path' ); |
210 | | - $path = substr( $path, strrpos( $path, ';' ) ); |
211 | | - return $path; |
212 | | -} |
213 | | - |
214 | | -/** |
215 | | - * Is dl() available to us? |
216 | | - * |
217 | | - * According to http://www.php.net/manual/en/function.dl.php, dl() |
218 | | - * is *not* available when `enable_dl` is off, or under `safe_mode` |
219 | | - * |
220 | | - * @return bool |
221 | | - */ |
222 | | -function mw_have_dl() { |
223 | | - return function_exists( 'dl' ) |
224 | | - && is_callable( 'dl' ) |
225 | | - && wfIniGetBool( 'enable_dl' ) |
226 | | - && !wfIniGetBool( 'safe_mode' ); |
227 | | -} |
Index: trunk/phase3/maintenance/eval.php |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | readline_read_history( $historyFile ); |
55 | 55 | } |
56 | 56 | |
57 | | -while ( ( $line = readconsole( '> ' ) ) !== false ) { |
| 57 | +while ( ( $line = Maintenance::readconsole() ) !== false ) { |
58 | 58 | if ( $useReadline ) { |
59 | 59 | readline_add_history( $line ); |
60 | 60 | readline_write_history( $historyFile ); |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -85,6 +85,8 @@ |
86 | 86 | 'envCheckMediaWikiVersion', |
87 | 87 | 'envCheckDB', |
88 | 88 | 'envCheckRegisterGlobals', |
| 89 | + 'envCheckBrokenXML', |
| 90 | + 'envCheckPHP531', |
89 | 91 | 'envCheckMagicQuotes', |
90 | 92 | 'envCheckMagicSybase', |
91 | 93 | 'envCheckMbstring', |
— | — | @@ -471,6 +473,30 @@ |
472 | 474 | } |
473 | 475 | |
474 | 476 | /** |
| 477 | + * Some versions of libxml+PHP break < and > encoding horribly |
| 478 | + */ |
| 479 | + public function envCheckBrokenXML() { |
| 480 | + $test = new PhpXmlBugTester(); |
| 481 | + if ( !$test->ok ) { |
| 482 | + $this->showMessage( 'config-brokenlibxml' ); |
| 483 | + return false; |
| 484 | + } |
| 485 | + } |
| 486 | + |
| 487 | + /** |
| 488 | + * Test PHP (probably 5.3.1, but it could regress again) to make sure that |
| 489 | + * reference parameters to __call() are not converted to null |
| 490 | + */ |
| 491 | + public function envCheckPHP531() { |
| 492 | + $test = new PhpRefCallBugTester; |
| 493 | + $test->execute(); |
| 494 | + if ( !$test->ok ) { |
| 495 | + $this->showMessage( 'config-using531' ); |
| 496 | + return false; |
| 497 | + } |
| 498 | + } |
| 499 | + |
| 500 | + /** |
475 | 501 | * Environment check for magic_quotes_runtime. |
476 | 502 | */ |
477 | 503 | public function envCheckMagicQuotes() { |
— | — | @@ -845,7 +871,7 @@ |
846 | 872 | * |
847 | 873 | * @return Array |
848 | 874 | */ |
849 | | - protected function getPossibleBinPaths() { |
| 875 | + protected static function getPossibleBinPaths() { |
850 | 876 | return array_merge( |
851 | 877 | array( '/usr/bin', '/usr/local/bin', '/opt/csw/bin', |
852 | 878 | '/usr/gnu/bin', '/usr/sfw/bin', '/sw/bin', '/opt/local/bin' ), |
— | — | @@ -869,7 +895,7 @@ |
870 | 896 | * If $versionInfo is not false, only executables with a version |
871 | 897 | * matching $versionInfo[1] will be returned. |
872 | 898 | */ |
873 | | - protected function locateExecutable( $path, $names, $versionInfo = false ) { |
| 899 | + public static function locateExecutable( $path, $names, $versionInfo = false ) { |
874 | 900 | if ( !is_array( $names ) ) { |
875 | 901 | $names = array( $names ); |
876 | 902 | } |
— | — | @@ -902,9 +928,9 @@ |
903 | 929 | * Same as locateExecutable(), but checks in getPossibleBinPaths() by default |
904 | 930 | * @see locateExecutable() |
905 | 931 | */ |
906 | | - protected function locateExecutableInDefaultPaths( $names, $versionInfo = false ) { |
907 | | - foreach( $this->getPossibleBinPaths() as $path ) { |
908 | | - $exe = $this->locateExecutable( $path, $names, $versionInfo ); |
| 932 | + public static function locateExecutableInDefaultPaths( $names, $versionInfo = false ) { |
| 933 | + foreach( self::getPossibleBinPaths() as $path ) { |
| 934 | + $exe = self::locateExecutable( $path, $names, $versionInfo ); |
909 | 935 | if( $exe !== false ) { |
910 | 936 | return $exe; |
911 | 937 | } |
Index: trunk/phase3/includes/installer/PhpBugTests.php |
— | — | @@ -0,0 +1,69 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Classes for self-contained tests for known bugs in PHP. |
| 5 | + * |
| 6 | + * This program is free software; you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU General Public License as published by |
| 8 | + * the Free Software Foundation; either version 2 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU General Public License along |
| 17 | + * with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | + * http://www.gnu.org/copyleft/gpl.html |
| 20 | + * |
| 21 | + * @file |
| 22 | + * @ingroup SpecialPage |
| 23 | + */ |
| 24 | + |
| 25 | +/** |
| 26 | + * Test for PHP+libxml2 bug which breaks XML input subtly with certain versions. |
| 27 | + * Known fixed with PHP 5.2.9 + libxml2-2.7.3 |
| 28 | + * @see http://bugs.php.net/bug.php?id=45996 |
| 29 | + */ |
| 30 | +class PhpXmlBugTester { |
| 31 | + private $parsedData = ''; |
| 32 | + public $ok = false; |
| 33 | + public function __construct() { |
| 34 | + $charData = '<b>c</b>'; |
| 35 | + $xml = '<a>' . htmlspecialchars( $charData ) . '</a>'; |
| 36 | + |
| 37 | + $parser = xml_parser_create(); |
| 38 | + xml_set_character_data_handler( $parser, array( $this, 'chardata' ) ); |
| 39 | + $parsedOk = xml_parse( $parser, $xml, true ); |
| 40 | + $this->ok = $parsedOk && ( $this->parsedData == $charData ); |
| 41 | + } |
| 42 | + public function chardata( $parser, $data ) { |
| 43 | + $this->parsedData .= $data; |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | +/** |
| 48 | + * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x) |
| 49 | + * @see http://bugs.php.net/bug.php?id=45996 |
| 50 | + */ |
| 51 | +class PhpRefCallBugTester { |
| 52 | + public $ok = false; |
| 53 | + |
| 54 | + function __call( $name, $args ) { |
| 55 | + $old = error_reporting( E_ALL & ~E_WARNING ); |
| 56 | + call_user_func_array( array( $this, 'checkForBrokenRef' ), $args ); |
| 57 | + error_reporting( $old ); |
| 58 | + } |
| 59 | + |
| 60 | + function checkForBrokenRef( &$var ) { |
| 61 | + if ( $var ) { |
| 62 | + $this->ok = true; |
| 63 | + } |
| 64 | + } |
| 65 | + |
| 66 | + function execute() { |
| 67 | + $var = true; |
| 68 | + call_user_func_array( array( $this, 'foo' ), array( &$var ) ); |
| 69 | + } |
| 70 | +} |
Property changes on: trunk/phase3/includes/installer/PhpBugTests.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 71 | + native |
Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -155,6 +155,10 @@ |
156 | 156 | 'config-uploads-safe' => 'The default directory for uploads is safe from arbitrary scripts execution.', |
157 | 157 | 'config-uploads-not-safe' => "'''Warning:''' Your default directory for uploads <code>$1</code> is vulnerable to arbitrary scripts execution. |
158 | 158 | Although MediaWiki checks all uploaded files for security threats, it is highly recommended to [http://www.mediawiki.org/wiki/Manual:Security#Upload_security close this security vulnerability] before enabling uploads.", |
| 159 | + 'config-brokenlibxml' => 'Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web apps. |
| 160 | +Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later! ABORTING ([http://bugs.php.net/bug.php?id=45996 bug filed with PHP]).', |
| 161 | + 'config-using531' => 'PHP $1 is not compatible with MediaWiki due to a bug involving reference parameters to <code>__call()</code>. |
| 162 | +Upgrade to PHP 5.3.2 or higher, or downgrade to PHP 5.3.0 to fix this. ABORTING ([http://bugs.php.net/bug.php?id=50394 bug filed with PHP])', |
159 | 163 | 'config-db-type' => 'Database type:', |
160 | 164 | 'config-db-host' => 'Database host:', |
161 | 165 | 'config-db-host-help' => 'If your database server is on different server, enter the host name or IP address here. |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -450,6 +450,8 @@ |
451 | 451 | 'WebInstallerOutput' => 'includes/installer/WebInstallerOutput.php', |
452 | 452 | 'MysqlInstaller' => 'includes/installer/MysqlInstaller.php', |
453 | 453 | 'MysqlUpdater' => 'includes/installer/MysqlUpdater.php', |
| 454 | + 'PhpXmlBugTester' => 'includes/installer/PhpBugTests.php', |
| 455 | + 'PhpRefCallBugTester' => 'includes/installer/PhpBugTests.php', |
454 | 456 | 'PostgresInstaller' => 'includes/installer/PostgresInstaller.php', |
455 | 457 | 'PostgresUpdater' => 'includes/installer/PostgresUpdater.php', |
456 | 458 | 'SqliteInstaller' => 'includes/installer/SqliteInstaller.php', |
Index: trunk/phase3/config/old-index.php |
— | — | @@ -1,47 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * MediaWiki web-based config/installation |
5 | | - * |
6 | | - * Copyright © 2004 Brion Vibber <brion@pobox.com>, 2006 Rob Church <robchur@gmail.com> |
7 | | - * http://www.mediawiki.org/ |
8 | | - * |
9 | | - * This program is free software; you can redistribute it and/or modify |
10 | | - * it under the terms of the GNU General Public License as published by |
11 | | - * the Free Software Foundation; either version 2 of the License, or |
12 | | - * (at your option) any later version. |
13 | | - * |
14 | | - * This program is distributed in the hope that it will be useful, |
15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | | - * GNU General Public License for more details. |
18 | | - * |
19 | | - * You should have received a copy of the GNU General Public License along |
20 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
21 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
22 | | - * http://www.gnu.org/copyleft/gpl.html |
23 | | - * |
24 | | - * @file |
25 | | - */ |
26 | | - |
27 | | -# Attempt to set up the include path, to fix problems with relative includes |
28 | | -$IP = dirname( dirname( __FILE__ ) ); |
29 | | -define( 'MW_INSTALL_PATH', $IP ); |
30 | | - |
31 | | -# Define an entry point and include some files |
32 | | -define( "MEDIAWIKI", true ); |
33 | | -define( "MEDIAWIKI_INSTALL", true ); |
34 | | - |
35 | | -# Check for PHP 5 |
36 | | -if ( !function_exists( 'version_compare' ) |
37 | | - || version_compare( phpversion(), '5.0.0' ) < 0 |
38 | | -) { |
39 | | - define( 'MW_PHP4', '1' ); |
40 | | - require( "$IP/includes/DefaultSettings.php" ); |
41 | | - require( "$IP/includes/templates/PHP4.php" ); |
42 | | - exit; |
43 | | -} |
44 | | - |
45 | | -// Isolate the rest of the code so this file can die out cleanly |
46 | | -// if we find we're running under PHP 4.x... We use PHP 5 syntax |
47 | | -// which doesn't parse under 4. |
48 | | -require( dirname( __FILE__ ) . "/Installer.php" ); |
Index: trunk/phase3/config/Installer.php |
— | — | @@ -1,31 +1,12 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * MediaWiki web-based config/installation |
| 4 | + * DO NOT USE ANY OF THIS CODE. BEING RETAINED FOR REFERENCE UNTIL JUST BEFORE |
| 5 | + * THE 1.17 BRANCH |
5 | 6 | * |
6 | | - * Copyright © 2004 Brion Vibber <brion@pobox.com>, 2006 Rob Church <robchur@gmail.com> |
7 | | - * http://www.mediawiki.org/ |
8 | | - * |
9 | | - * This program is free software; you can redistribute it and/or modify |
10 | | - * it under the terms of the GNU General Public License as published by |
11 | | - * the Free Software Foundation; either version 2 of the License, or |
12 | | - * (at your option) any later version. |
13 | | - * |
14 | | - * This program is distributed in the hope that it will be useful, |
15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | | - * GNU General Public License for more details. |
18 | | - * |
19 | | - * You should have received a copy of the GNU General Public License along |
20 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
21 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
22 | | - * http://www.gnu.org/copyleft/gpl.html |
23 | | - * |
24 | 7 | * @file |
25 | 8 | */ |
26 | 9 | |
27 | | -if( !defined( 'MEDIAWIKI_INSTALL' ) ) { |
28 | | - die( 'Not an entry point.' ); |
29 | | -} |
| 10 | +die( 'Now nearly 100% obsolete!' ); |
30 | 11 | |
31 | 12 | error_reporting( E_ALL | E_STRICT ); |
32 | 13 | header( "Content-type: text/html; charset=utf-8" ); |