* @ingroup Maintenance
*/
+if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.1.0' ) < 0 ) ) {
+ echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP 5.1.0 or higher. ABORTING.\n" .
+ "Check if you have a newer php executable with a different name, such as php5.\n";
+ die( 1 );
+}
+
$wgUseMasterForMaintenance = true;
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
class UpdateMediaWiki extends Maintenance {
- public function __construct() {
+ function __construct() {
parent::__construct();
$this->mDescription = "MediaWiki database updater";
$this->addOption( 'skip-compat-checks', 'Skips compatibility checks, mostly for developers' );
$this->addOption( 'nopurge', 'Do not purge the objectcache table after updates' );
}
- public function getDbType() {
- return Maintenance::DB_ADMIN;
+ function getDbType() {
+ return DB_ADMIN;
}
- public function execute() {
+ function execute() {
global $wgVersion, $wgTitle, $wgLang;
$wgLang = Language::factory( 'en' );
$updater->doUpdates( $purge );
foreach( $updater->getPostDatabaseUpdateMaintenance() as $maint ) {
- $this->runChild( $maint )->execute();
+ $child = $this->runChild( $maint );
+ $child->execute();
}
$this->output( "\nDone.\n" );
}
- protected function afterFinalSetup() {
+ function afterFinalSetup() {
global $wgLocalisationCacheConf;
# Don't try to access the database