r24690 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24689‎ | r24690 | r24691 >
Date:22:37, 8 August 2007
Author:brion
Status:old
Tags:
Comment:
* Make installer include_path-independent, so it should work on hosts which
disable user setting of PHP include_path setting
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/config/index.php (modified) (history)

Diff [purge]

Index: trunk/phase3/config/index.php
@@ -29,10 +29,6 @@
3030 # Attempt to set up the include path, to fix problems with relative includes
3131 $IP = dirname( dirname( __FILE__ ) );
3232 define( 'MW_INSTALL_PATH', $IP );
33 -$sep = PATH_SEPARATOR;
34 -if( !ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" ) ) {
35 - set_include_path( ".$sep$IP$sep$IP/includes$sep$IP/languages" );
36 -}
3733
3834 # Define an entry point and include some files
3935 define( "MEDIAWIKI", true );
@@ -40,17 +36,17 @@
4137
4238 // Run version checks before including other files
4339 // so people don't see a scary parse error.
44 -require_once( "install-utils.inc" );
 40+require_once( "$IP/install-utils.inc" );
4541 install_version_checks();
4642
47 -require_once( "includes/Defines.php" );
48 -require_once( "includes/DefaultSettings.php" );
49 -require_once( "includes/AutoLoader.php" );
50 -require_once( "includes/MagicWord.php" );
51 -require_once( "includes/Namespace.php" );
52 -require_once( "includes/ProfilerStub.php" );
53 -require_once( "includes/GlobalFunctions.php" );
54 -require_once( "includes/Hooks.php" );
 43+require_once( "$IP/includes/Defines.php" );
 44+require_once( "$IP/includes/DefaultSettings.php" );
 45+require_once( "$IP/includes/AutoLoader.php" );
 46+require_once( "$IP/includes/MagicWord.php" );
 47+require_once( "$IP/includes/Namespace.php" );
 48+require_once( "$IP/includes/ProfilerStub.php" );
 49+require_once( "$IP/includes/GlobalFunctions.php" );
 50+require_once( "$IP/includes/Hooks.php" );
5551
5652 # If we get an exception, the user needs to know
5753 # all the details
@@ -232,8 +228,8 @@
233229 }
234230
235231
236 -require_once( "install-utils.inc" );
237 -require_once( "maintenance/updaters.inc" );
 232+require_once( "$IP/install-utils.inc" );
 233+require_once( "$IP/maintenance/updaters.inc" );
238234
239235 class ConfigData {
240236 function getEncoded( $data ) {
@@ -497,7 +493,7 @@
498494 "/opt/csw/bin",
499495 "/usr/gnu/bin",
500496 "/usr/sfw/bin" ),
501 - explode( $sep, getenv( "PATH" ) ) );
 497+ explode( PATH_SEPARATOR, getenv( "PATH" ) ) );
502498 $diff3names = array( "gdiff3", "diff3", "diff3.exe" );
503499
504500 $diff3versioninfo = array( '$1 --version 2>&1', 'diff3 (GNU diffutils)' );
@@ -548,6 +544,7 @@
549545 $path = ($_SERVER["PHP_SELF"] === '')
550546 ? $_SERVER["SCRIPT_NAME"]
551547 : $_SERVER["PHP_SELF"];
 548+
552549 $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $path );
553550 print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n";
554551
@@ -755,7 +752,7 @@
756753
757754 $wgCommandLineMode = true;
758755 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
759 - require_once( "includes/Setup.php" );
 756+ require_once( "$IP/includes/Setup.php" );
760757 chdir( "config" );
761758
762759 $wgTitle = Title::newFromText( "Installation script" );
@@ -1566,7 +1563,7 @@
15671564 \$path = array( \$IP, \"\$IP/includes\", \"\$IP/languages\" );
15681565 set_include_path( implode( PATH_SEPARATOR, \$path ) . PATH_SEPARATOR . get_include_path() );
15691566
1570 -require_once( \"includes/DefaultSettings.php\" );
 1567+require_once( \"\$IP/includes/DefaultSettings.php\" );
15711568
15721569 # If PHP's memory limit is very low, some operations may fail.
15731570 " . ($conf->raiseMemory ? '' : '# ' ) . "ini_set( 'memory_limit', '20M' );" . "
@@ -1755,9 +1752,9 @@
17561753 }
17571754
17581755 function getLanguageList() {
1759 - global $wgLanguageNames;
 1756+ global $wgLanguageNames, $IP;
17601757 if( !isset( $wgLanguageNames ) ) {
1761 - require_once( "languages/Names.php" );
 1758+ require_once( "$IP/languages/Names.php" );
17621759 }
17631760
17641761 $codes = array();
Index: trunk/phase3/RELEASE-NOTES
@@ -367,7 +367,10 @@
368368 * (bug 4530) Fix local name of Kurdish language
369369 * (bug 10830) Fix local name Haitian Creole language
370370 * Fix comments in contributions and log pages for RTL languages
 371+* Make installer include_path-independent, so it should work on hosts which
 372+ disable user setting of PHP include_path setting
371373
 374+
372375 == API changes since 1.10 ==
373376
374377 Full API documentation is available at http://www.mediawiki.org/wiki/API

Follow-up revisions

RevisionCommit summaryAuthorDate
r24705Merged revisions 24632-24693 via svnmerge from...david19:15, 9 August 2007

Status & tagging log