r85881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85880‎ | r85881 | r85882 >
Date:15:37, 12 April 2011
Author:maxsem
Status:ok
Tags:
Comment:
Made install.php fail gracefully on PHP4
Modified paths:
  • /trunk/phase3/maintenance/install.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/install.php
@@ -20,12 +20,18 @@
2121 * @see wfWaitForSlaves()
2222 */
2323
 24+if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.2.3' ) < 0 ) ) {
 25+ echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP 5.2.3 or higher. ABORTING.\n" .
 26+ "Check if you have a newer php executable with a different name, such as php5.\n";
 27+ die( 1 );
 28+}
 29+
2430 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
2531
2632 require_once( dirname( dirname( __FILE__ ) )."/maintenance/Maintenance.php" );
2733
2834 class CommandLineInstaller extends Maintenance {
29 - public function __construct() {
 35+ function __construct() {
3036 parent::__construct();
3137 global $IP;
3238
@@ -54,7 +60,7 @@
5561 $this->addOption( 'env-checks', "Run environment checks only, don't change anything" );
5662 }
5763
58 - public function execute() {
 64+ function execute() {
5965 global $IP, $wgTitle;
6066 $siteName = isset( $this->mArgs[0] ) ? $this->mArgs[0] : "Don't care"; // Will not be set if used with --env-checks
6167 $adminName = isset( $this->mArgs[1] ) ? $this->mArgs[1] : null;
@@ -76,7 +82,7 @@
7783 }
7884 }
7985
80 - protected function validateParamsAndArgs() {
 86+ function validateParamsAndArgs() {
8187 if ( !$this->hasOption( 'env-checks' ) ) {
8288 parent::validateParamsAndArgs();
8389 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r864741.17: MFT r81731, r85377, r85547, r85555, r85583, r85803, r85881, r86100, r86...catrope13:22, 20 April 2011

Status & tagging log