Make revdel input form more consistent with other forms:
[lhc/web/wiklou.git] / maintenance / doMaintenance.php
index dbb0352..3453a5f 100644 (file)
@@ -5,11 +5,35 @@
  * because A) included files are not in global scope, but in the scope 
  * of their caller, and B) MediaWiki has way too many globals. So instead
  * we'll kinda fake it, and do the requires() inline. <3 PHP
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @author Chad Horohoe <chad@anyonecanedit.org>
+ * @file
+ * @ingroup Maintenance
  */
 
-if( !isset( $maintClass ) || !class_exists( $maintClass ) ) {
+if ( !defined( 'DO_MAINTENANCE' ) ) {
+       echo "This file must be included after Maintenance.php\n";
+       exit( 1 );
+}
+
+if( !$maintClass || !class_exists( $maintClass ) ) {
        echo "\$maintClass is not set or is set to a non-existent class.";
-       die();
+       exit( 1 );
 }
 
 if( defined( 'MW_NO_SETUP' ) ) {
@@ -22,6 +46,10 @@ $maintenance = new $maintClass();
 // Basic sanity checks and such
 $maintenance->setup();
 
+// We used to call this variable $self, but it was moved
+// to $maintenance->mSelf. Keep that here for b/c
+$self = $maintenance->getName();
+
 # Setup the profiler
 if ( file_exists( "$IP/StartProfiler.php" ) ) {
        require_once( "$IP/StartProfiler.php" );
@@ -35,7 +63,7 @@ if( file_exists( dirname(__FILE__).'/wikimedia-mode' ) ) {
        # Maybe a hook?
        global $cluster;
        $wgWikiFarm = true;
-       $cluster = 'pmtma';
+       $cluster = 'pmtpa';
        require_once( "$IP/includes/AutoLoader.php" );
        require_once( "$IP/includes/SiteConfiguration.php" );
        require( "$IP/wgConf.php" );
@@ -47,14 +75,20 @@ if( file_exists( dirname(__FILE__).'/wikimedia-mode' ) ) {
        require_once( "$IP/includes/Defines.php" );
        require_once( $maintenance->loadSettings() );
 }
+$maintenance->finalSetup();
 // Some last includes
 require_once( "$IP/includes/Setup.php" );
-require_once( "$IP/install-utils.inc" );
+require_once( "$IP/maintenance/install-utils.inc" );
 
-$wgTitle = null; # Much much faster startup than creating a title object
+// Much much faster startup than creating a title object
+$wgTitle = null; 
 
+// Do the work
 try {
        $maintenance->execute();
 } catch( MWException $mwe ) {
        echo( $mwe->getText() );
-}
\ No newline at end of file
+}
+
+// Potentially debug globals
+$maintenance->globals();