Index: trunk/phase3/maintenance/update.php |
— | — | @@ -9,12 +9,18 @@ |
10 | 10 | * @ingroup Maintenance |
11 | 11 | */ |
12 | 12 | |
| 13 | +if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.1.0' ) < 0 ) ) { |
| 14 | + echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP 5.1.0 or higher. ABORTING.\n" . |
| 15 | + "Check if you have a newer php executable with a different name, such as php5.\n"; |
| 16 | + die( 1 ); |
| 17 | +} |
| 18 | + |
13 | 19 | $wgUseMasterForMaintenance = true; |
14 | 20 | require_once( dirname( __FILE__ ) . '/Maintenance.php' ); |
15 | 21 | |
16 | 22 | class UpdateMediaWiki extends Maintenance { |
17 | 23 | |
18 | | - public function __construct() { |
| 24 | + function __construct() { |
19 | 25 | parent::__construct(); |
20 | 26 | $this->mDescription = "MediaWiki database updater"; |
21 | 27 | $this->addOption( 'skip-compat-checks', 'Skips compatibility checks, mostly for developers' ); |
— | — | @@ -23,11 +29,11 @@ |
24 | 30 | $this->addOption( 'nopurge', 'Do not purge the objectcache table after updates' ); |
25 | 31 | } |
26 | 32 | |
27 | | - public function getDbType() { |
28 | | - return Maintenance::DB_ADMIN; |
| 33 | + function getDbType() { |
| 34 | + return DB_ADMIN; |
29 | 35 | } |
30 | 36 | |
31 | | - public function execute() { |
| 37 | + function execute() { |
32 | 38 | global $wgVersion, $wgTitle, $wgLang; |
33 | 39 | |
34 | 40 | $wgLang = Language::factory( 'en' ); |
— | — | @@ -61,13 +67,14 @@ |
62 | 68 | $updater->doUpdates( $purge ); |
63 | 69 | |
64 | 70 | foreach( $updater->getPostDatabaseUpdateMaintenance() as $maint ) { |
65 | | - $this->runChild( $maint )->execute(); |
| 71 | + $child = $this->runChild( $maint ); |
| 72 | + $child->execute(); |
66 | 73 | } |
67 | 74 | |
68 | 75 | $this->output( "\nDone.\n" ); |
69 | 76 | } |
70 | 77 | |
71 | | - protected function afterFinalSetup() { |
| 78 | + function afterFinalSetup() { |
72 | 79 | global $wgLocalisationCacheConf; |
73 | 80 | |
74 | 81 | # Don't try to access the database |