Index: trunk/phase3/includes/Setup.php |
— | — | @@ -28,8 +28,8 @@ |
29 | 29 | } |
30 | 30 | |
31 | 31 | // Set various default paths sensibly... |
32 | | -if( $wgScript === false ) $wgScript = "$wgScriptPath/index.php"; |
33 | | -if( $wgRedirectScript === false ) $wgRedirectScript = "$wgScriptPath/redirect.php"; |
| 32 | +if( $wgScript === false ) $wgScript = "$wgScriptPath/index$wgScriptExtension"; |
| 33 | +if( $wgRedirectScript === false ) $wgRedirectScript = "$wgScriptPath/redirect$wgScriptExtension"; |
34 | 34 | |
35 | 35 | if( $wgArticlePath === false ) { |
36 | 36 | if( $wgUsePathInfo ) { |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -125,8 +125,9 @@ |
126 | 126 | * in LocalSettings.php. Generally you should not need to change this |
127 | 127 | * unless you don't like seeing "index.php". |
128 | 128 | */ |
129 | | -$wgScript = false; /// defaults to "{$wgScriptPath}/index.php" |
130 | | -$wgRedirectScript = false; /// defaults to "{$wgScriptPath}/redirect.php" |
| 129 | +$wgScriptExtension = '.php'; /// extension to append to script names by default |
| 130 | +$wgScript = false; /// defaults to "{$wgScriptPath}/index{$wgScriptExtension}" |
| 131 | +$wgRedirectScript = false; /// defaults to "{$wgScriptPath}/redirect{$wgScriptExtension}" |
131 | 132 | /**#@-*/ |
132 | 133 | |
133 | 134 | |
— | — | @@ -443,7 +444,7 @@ |
444 | 445 | * apache servers don't have read/write access to the thumbnail path. |
445 | 446 | * |
446 | 447 | * Example: |
447 | | - * $wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php"; |
| 448 | + * $wgThumbnailScriptPath = "{$wgScriptPath}/thumb{$wgScriptExtension}"; |
448 | 449 | */ |
449 | 450 | $wgThumbnailScriptPath = false; |
450 | 451 | $wgSharedThumbnailScriptPath = false; |
Index: trunk/phase3/img_auth.php5 |
— | — | @@ -0,0 +1 @@ |
| 2 | +<?php require './img_auth.php'; ?> |
Index: trunk/phase3/install-utils.inc |
— | — | @@ -11,7 +11,9 @@ |
12 | 12 | die( -1 ); |
13 | 13 | } |
14 | 14 | if( version_compare( phpversion(), '5.0.0' ) < 0 ) { |
15 | | - echo "PHP 5.0.0 or higher is required. ABORTING.\n"; |
| 15 | + echo "PHP 5.0.0 or higher is required. If PHP 5 is available only when \n". |
| 16 | + "PHP files have a .php5 extension, please navigate to <a href=\"index.php5\">index.php5</a> \n". |
| 17 | + "to continue installation. ABORTING.\n"; |
16 | 18 | die( -1 ); |
17 | 19 | } |
18 | 20 | |
— | — | @@ -122,4 +124,4 @@ |
123 | 125 | return $path; |
124 | 126 | } |
125 | 127 | |
126 | | -?> |
\ No newline at end of file |
| 128 | +?> |
Index: trunk/phase3/redirect.php5 |
— | — | @@ -0,0 +1 @@ |
| 2 | +<?php require './redirect.php'; ?> |
Index: trunk/phase3/index.php5 |
— | — | @@ -0,0 +1 @@ |
| 2 | +<?php require './index.php'; ?> |
Index: trunk/phase3/api.php5 |
— | — | @@ -0,0 +1,2 @@ |
| 2 | +<?php require 'api.php'; ?> |
| 3 | +<?php require 'api.php'; ?> |
\ No newline at end of file |
Index: trunk/phase3/thumb.php5 |
— | — | @@ -0,0 +1 @@ |
| 2 | +<?php require './thumb.php'; ?> |
Index: trunk/phase3/config/index.php5 |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +define('MW_INSTALL_PHP5_EXT', 1); |
| 5 | +require './index.php'; |
| 6 | + |
| 7 | +?> |
Index: trunk/phase3/config/index.php |
— | — | @@ -201,7 +201,8 @@ |
202 | 202 | /* Check for existing configurations and bug out! */ |
203 | 203 | |
204 | 204 | if( file_exists( "../LocalSettings.php" ) ) { |
205 | | - dieout( "<p><strong>Setup has completed, <a href='../index.php'>your wiki</a> is configured.</strong></p> |
| 205 | + $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php'; |
| 206 | + dieout( "<p><strong>Setup has completed, <a href='../$script'>your wiki</a> is configured.</strong></p> |
206 | 207 | |
207 | 208 | <p>Please delete the /config directory for extra security.</p></div></div></div></div>" ); |
208 | 209 | } |
— | — | @@ -393,10 +394,11 @@ |
394 | 395 | |
395 | 396 | $sapi = php_sapi_name(); |
396 | 397 | print "<li>PHP server API is $sapi; "; |
| 398 | +$script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php'; |
397 | 399 | if( $wgUsePathInfo ) { |
398 | | - print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)"; |
| 400 | + print "ok, using pretty URLs (<tt>$script/Page_Title</tt>)"; |
399 | 401 | } else { |
400 | | - print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)"; |
| 402 | + print "using ugly URLs (<tt>$script?title=Page_Title</tt>)"; |
401 | 403 | } |
402 | 404 | print "</li>\n"; |
403 | 405 | |
— | — | @@ -549,6 +551,18 @@ |
550 | 552 | $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $path ); |
551 | 553 | print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n"; |
552 | 554 | |
| 555 | + |
| 556 | + |
| 557 | +// We may be installing from *.php5 extension file, if so, print message |
| 558 | +$conf->ScriptExtension = '.php'; |
| 559 | +if (defined('MW_INSTALL_PHP5_EXT')) { |
| 560 | + $conf->ScriptExtension = '.php5'; |
| 561 | + print "<li>Installing MediaWiki with <tt>php5</tt> file extensions</li>\n"; |
| 562 | +} else { |
| 563 | + print "<li>Installing MediaWiki with <tt>php</tt> file extensions</li>\n"; |
| 564 | +} |
| 565 | + |
| 566 | + |
553 | 567 | print "<li style='font-weight:bold;color:green;font-size:110%'>Environment checked. You can install MediaWiki.</li>\n"; |
554 | 568 | $conf->posted = ($_SERVER["REQUEST_METHOD"] == "POST"); |
555 | 569 | |
— | — | @@ -631,7 +645,7 @@ |
632 | 646 | if( $conf->SysopName ) { |
633 | 647 | # Check that the user can be created |
634 | 648 | $u = User::newFromName( $conf->SysopName ); |
635 | | - if( $u instanceof User ) { |
| 649 | + if( is_a($u, 'User') ) { // please do not use instanceof, it breaks PHP4 |
636 | 650 | # Various password checks |
637 | 651 | if( $conf->SysopPass != '' ) { |
638 | 652 | if( $conf->SysopPass == $conf->SysopPass2 ) { |
— | — | @@ -1097,7 +1111,7 @@ |
1098 | 1112 | } |
1099 | 1113 | ?> |
1100 | 1114 | |
1101 | | -<form action="index.php" name="config" method="post"> |
| 1115 | +<form action="<?php echo defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php'; ?>" name="config" method="post"> |
1102 | 1116 | |
1103 | 1117 | |
1104 | 1118 | <h2>Site config</h2> |
— | — | @@ -1148,7 +1162,8 @@ |
1149 | 1163 | <li><?php |
1150 | 1164 | aField( $conf, "License", "A Creative Commons license - ", "radio", "cc" ); |
1151 | 1165 | $partner = "MediaWiki"; |
1152 | | - $exit = urlencode( "$wgServer{$conf->ScriptPath}/config/index.php?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" ); |
| 1166 | + $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php'; |
| 1167 | + $exit = urlencode( "$wgServer{$conf->ScriptPath}/config/$script?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" ); |
1153 | 1168 | $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" ); |
1154 | 1169 | $ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" ); |
1155 | 1170 | print "<a href=\"$ccApp\" target='_blank'>choose</a>"; |
— | — | @@ -1418,6 +1433,7 @@ |
1419 | 1434 | |
1420 | 1435 | /* -------------------------------------------------------------------------------------- */ |
1421 | 1436 | function writeSuccessMessage() { |
| 1437 | + $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php'; |
1422 | 1438 | if ( ini_get( 'safe_mode' ) && !ini_get( 'open_basedir' ) ) { |
1423 | 1439 | echo <<<EOT |
1424 | 1440 | <div class="success-box"> |
— | — | @@ -1427,7 +1443,7 @@ |
1428 | 1444 | <li>Download config/LocalSettings.php with your FTP client or file manager</li> |
1429 | 1445 | <li>Upload it to the parent directory</li> |
1430 | 1446 | <li>Delete config/LocalSettings.php</li> |
1431 | | - <li>Start using <a href='../index.php'>your wiki</a>! |
| 1447 | + <li>Start using <a href='../$script'>your wiki</a>! |
1432 | 1448 | </ol> |
1433 | 1449 | <p>If you are in a shared hosting environment, do <strong>not</strong> just move LocalSettings.php |
1434 | 1450 | remotely. LocalSettings.php is currently owned by the user your webserver is running under, |
— | — | @@ -1441,7 +1457,7 @@ |
1442 | 1458 | <p> |
1443 | 1459 | <span class="success-message">Installation successful!</span> |
1444 | 1460 | Move the <tt>config/LocalSettings.php</tt> file to the parent directory, then follow |
1445 | | -<a href="../index.php"> this link</a> to your wiki.</p> |
| 1461 | +<a href="../$script"> this link</a> to your wiki.</p> |
1446 | 1462 | <p>You should change file permissions for <tt>LocalSettings.php</tt> as required to |
1447 | 1463 | prevent other users on the server reading passwords and altering configuration data.</p> |
1448 | 1464 | </div> |
— | — | @@ -1568,6 +1584,7 @@ |
1569 | 1585 | ## The URL base path to the directory containing the wiki; |
1570 | 1586 | ## defaults for all runtime URL paths are based off of this. |
1571 | 1587 | \$wgScriptPath = \"{$slconf['ScriptPath']}\"; |
| 1588 | +\$wgScriptExtension = \"{$slconf['ScriptExtension']}\"; |
1572 | 1589 | |
1573 | 1590 | ## For more information on customizing the URLs please see: |
1574 | 1591 | ## http://www.mediawiki.org/wiki/Manual:Short_URL |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -110,7 +110,10 @@ |
111 | 111 | * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over |
112 | 112 | usergroup assignment. |
113 | 113 | * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information |
| 114 | +* (bug 10387) Detect and handle '.php5' extension environments at install time |
| 115 | + Patch by Edward Z. Yang. |
114 | 116 | |
| 117 | + |
115 | 118 | == Bugfixes since 1.10 == |
116 | 119 | |
117 | 120 | * (bug 9712) Use Arabic comma in date/time formats for Arabic and Farsi |