Merge maintenance-work branch:
[lhc/web/wiklou.git] / maintenance / showJobs.php
index 6e38c85..49b825f 100644 (file)
@@ -9,10 +9,19 @@
  * @author Tim Starling
  * @author Ashar Voultoiz
  */
-require_once( 'commandLine.inc' );
-
-$dbw = wfGetDB( DB_MASTER );
-$count = $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' );
-print $count."\n";
+require_once( "Maintenance.php" );
 
+class ShowJobs extends Maintenance {
+       public function __construct() {
+               parent::__construct();
+               $this->mDescription = "Show number of jobs waiting in master database";
+       }
+       public function execute() {
+               $dbw = wfGetDB( DB_MASTER );
+               $this->output( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) . "\n" );
+       }
+}
 
+$maintClass = "ShowJobs";
+require_once( DO_MAINTENANCE );