wiki.techinc.nl/maintenance/update.php

42 lines
961 B
PHP
Raw Normal View History

<?php
/**
* Run all updaters.
*
* This is used when the database schema is modified and we need to apply patches.
*
* @file
* @todo document
* @ingroup Maintenance
*/
/** */
2005-08-20 01:57:32 +00:00
$wgUseMasterForMaintenance = true;
require( "commandLine.inc" );
require( "updaters.inc" );
$wgTitle = Title::newFromText( "MediaWiki database updater" );
echo( "MediaWiki {$wgVersion} Updater\n\n" );
install_version_checks();
# Attempt to connect to the database as a privileged user
# This will vomit up an error if there are permissions problems
$wgDatabase = wfGetDB( DB_MASTER );
print "Going to run database updates for ".wfWikiID()."\n";
print "Depending on the size of your database this may take a while!\n";
if( !isset( $options['quick'] ) ) {
2005-06-22 10:11:08 +00:00
print "Abort with control-c in the next five seconds... ";
wfCountDown( 5 );
}
$shared = isset( $options['doshared'] );
$purge = !isset( $options['nopurge'] );
do_all_updates( $shared, $purge );
print "Done.\n";