r76220 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76219‎ | r76220 | r76221 >
Date:22:16, 6 November 2010
Author:demon
Status:ok (Comments)
Tags:
Comment:
Trying to kill install-utils.inc/old install crap:
* Cripple the old installer (entry point is gone, supporting code immediately exits). Keeping the latter for reference still :)
* Move posix_isatty() wrapper to Maintenance.php, all CLI scripts include this
* Clarify docs on archive() deprecation and removal - hasn't been used going back thru 1.15
* Clarify docs on dbsource() deprecation and removal - was in wide use thru 1.15. 1.16 removed all extension usages
* Move the two PHP bug tests to a file with the other installer files, moved them to more logical places in new install/update sequence
* Remove mw_have_dl/mw_get_session_save_path, zero callers
* Move readconsole() and helpers to be a static method on Maintenance, no extensions have used it since 1.15 either
Modified paths:
  • /trunk/phase3/config/Installer.php (modified) (history)
  • /trunk/phase3/config/old-index.php (deleted) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)
  • /trunk/phase3/includes/installer/PhpBugTests.php (added) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/eval.php (modified) (history)
  • /trunk/phase3/maintenance/install-utils.inc (modified) (history)
  • /trunk/phase3/maintenance/mcc.php (modified) (history)
  • /trunk/phase3/maintenance/update.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mcc.php
@@ -46,7 +46,7 @@
4747 $showhelp = false;
4848 $quit = false;
4949
50 - $line = readconsole( '> ' );
 50+ $line = Maintenance::readconsole();
5151 if ( $line === false ) exit;
5252
5353 $args = explode( ' ', $line );
Index: trunk/phase3/maintenance/update.php
@@ -35,6 +35,30 @@
3636 return 2 /* Maintenance::DB_ADMIN */;
3737 }
3838
 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+
3963 function execute() {
4064 global $wgVersion, $wgTitle, $wgLang;
4165
@@ -44,7 +68,7 @@
4569 $this->output( "MediaWiki {$wgVersion} Updater\n\n" );
4670
4771 if ( !$this->hasOption( 'skip-compat-checks' ) ) {
48 - install_version_checks();
 72+ $this->compatChecks();
4973 } else {
5074 $this->output( "Skipping compatibility checks, proceed at your own risk (Ctrl+C to abort)\n" );
5175 wfCountdown( 5 );
Index: trunk/phase3/maintenance/Maintenance.php
@@ -18,6 +18,15 @@
1919 "administrator.\n" );
2020 }
2121
 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+
2231 /**
2332 * Abstract maintenance class for quickly writing and churning out
2433 * maintenance scripts with minimal effort. All that _must_ be defined
@@ -1044,6 +1053,72 @@
10451054 return $title;
10461055 }
10471056
 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+ }
10481123 }
10491124
10501125 class FakeMaintenance extends Maintenance {
Index: trunk/phase3/maintenance/install-utils.inc
@@ -1,182 +1,14 @@
22 <?php
3 -
43 /**
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.
76 *
87 * @file
98 */
109
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 -
5310 /**
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
5712 */
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 -#
18113 function dbsource( $fname, $db = false ) {
18214 wfDeprecated( __METHOD__ );
18315 if ( !$db ) {
@@ -189,38 +21,11 @@
19022 }
19123 }
19224
 25+/**
 26+ * @deprecated Use DatabaseBase::patchPath(). Will probably be removed in 1.18
 27+ */
19328 function archive( $name ) {
19429 wfDeprecated( __METHOD__ );
19530 $dbr = wfGetDB( DB_SLAVE );
19631 return $dbr->patchPath( $name );
19732 }
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 @@
5454 readline_read_history( $historyFile );
5555 }
5656
57 -while ( ( $line = readconsole( '> ' ) ) !== false ) {
 57+while ( ( $line = Maintenance::readconsole() ) !== false ) {
5858 if ( $useReadline ) {
5959 readline_add_history( $line );
6060 readline_write_history( $historyFile );
Index: trunk/phase3/includes/installer/Installer.php
@@ -85,6 +85,8 @@
8686 'envCheckMediaWikiVersion',
8787 'envCheckDB',
8888 'envCheckRegisterGlobals',
 89+ 'envCheckBrokenXML',
 90+ 'envCheckPHP531',
8991 'envCheckMagicQuotes',
9092 'envCheckMagicSybase',
9193 'envCheckMbstring',
@@ -471,6 +473,30 @@
472474 }
473475
474476 /**
 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+ /**
475501 * Environment check for magic_quotes_runtime.
476502 */
477503 public function envCheckMagicQuotes() {
@@ -845,7 +871,7 @@
846872 *
847873 * @return Array
848874 */
849 - protected function getPossibleBinPaths() {
 875+ protected static function getPossibleBinPaths() {
850876 return array_merge(
851877 array( '/usr/bin', '/usr/local/bin', '/opt/csw/bin',
852878 '/usr/gnu/bin', '/usr/sfw/bin', '/sw/bin', '/opt/local/bin' ),
@@ -869,7 +895,7 @@
870896 * If $versionInfo is not false, only executables with a version
871897 * matching $versionInfo[1] will be returned.
872898 */
873 - protected function locateExecutable( $path, $names, $versionInfo = false ) {
 899+ public static function locateExecutable( $path, $names, $versionInfo = false ) {
874900 if ( !is_array( $names ) ) {
875901 $names = array( $names );
876902 }
@@ -902,9 +928,9 @@
903929 * Same as locateExecutable(), but checks in getPossibleBinPaths() by default
904930 * @see locateExecutable()
905931 */
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 );
909935 if( $exe !== false ) {
910936 return $exe;
911937 }
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
171 + native
Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -155,6 +155,10 @@
156156 'config-uploads-safe' => 'The default directory for uploads is safe from arbitrary scripts execution.',
157157 'config-uploads-not-safe' => "'''Warning:''' Your default directory for uploads <code>$1</code> is vulnerable to arbitrary scripts execution.
158158 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])',
159163 'config-db-type' => 'Database type:',
160164 'config-db-host' => 'Database host:',
161165 '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 @@
451451 'WebInstallerOutput' => 'includes/installer/WebInstallerOutput.php',
452452 'MysqlInstaller' => 'includes/installer/MysqlInstaller.php',
453453 'MysqlUpdater' => 'includes/installer/MysqlUpdater.php',
 454+ 'PhpXmlBugTester' => 'includes/installer/PhpBugTests.php',
 455+ 'PhpRefCallBugTester' => 'includes/installer/PhpBugTests.php',
454456 'PostgresInstaller' => 'includes/installer/PostgresInstaller.php',
455457 'PostgresUpdater' => 'includes/installer/PostgresUpdater.php',
456458 '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 @@
22 <?php
33 /**
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
56 *
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 - *
247 * @file
258 */
269
27 -if( !defined( 'MEDIAWIKI_INSTALL' ) ) {
28 - die( 'Not an entry point.' );
29 -}
 10+die( 'Now nearly 100% obsolete!' );
3011
3112 error_reporting( E_ALL | E_STRICT );
3213 header( "Content-type: text/html; charset=utf-8" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r76221Fix two errors from r76220:...ialex22:34, 6 November 2010
r78300Followup r76220: locateExecutableInDefaultPaths() was made static, so use sta...catrope13:13, 13 December 2010
r78375Style fix for r76220demon12:51, 14 December 2010

Comments

#Comment by 😂 (talk | contribs)   22:25, 6 November 2010

I lied here:

"Clarify docs on dbsource() deprecation and removal - was in wide use thru 1.15. 1.16 removed all extension usages"

dbsource() was used in 1.16 in 3 extensions still.

#Comment by Reedy (talk | contribs)   22:25, 6 November 2010

+die( 'Now nearly 100% obsolete!' );

D
#Comment by Catrope (talk | contribs)   13:16, 13 December 2010
+			if ( posix_isatty( 0 /*STDIN*/ ) ) {
+				$isatty = true;
+			} else {
+				$isatty = false;
+			}

Why not do $isatty = posix_isatty( 0 ); ?

Status & tagging log