mDescription = "Show number of jobs waiting in master database"; $this->addOption( 'group', 'Show number of jobs per job type' ); } public function execute() { $group = JobQueueGroup::singleton(); if ( $this->hasOption( 'group' ) ) { foreach ( $group->getQueueTypes() as $type ) { $queue = $group->get( $type ); $pending = $queue->getSize(); $claimed = $queue->getAcquiredCount(); if ( ( $pending + $claimed ) > 0 ) { $this->output( "{$type}: $pending queued; $claimed acquired\n" ); } } } else { $count = 0; foreach ( $group->getQueueTypes() as $type ) { $count += $group->get( $type )->getSize(); } $this->output( "$count\n" ); } } } $maintClass = "ShowJobs"; require_once( RUN_MAINTENANCE_IF_MAIN );