}
public function execute() {
- $async = $this->getOption( 'async', false );
- $dryrun = $this->getOption( 'dry-run', false );
+ $async = $this->hasOption( 'async' );
+ $dryrun = $this->hasOption( 'dry-run' );
if ( $this->hasOption( 'title' ) ) {
$title = Title::newFromText( $this->getOption( 'title' ) );
}
$this->identifier = $this->getOption( 'identifier', wfWikiID() );
$this->compress = $this->getOption( 'compress', 'yes' ) !== 'no';
- $this->skipRedirects = $this->getOption( 'skip-redirects', false ) !== false;
+ $this->skipRedirects = $this->hasOption( 'skip-redirects' );
$this->dbr = $this->getDB( DB_REPLICA );
$this->generateNamespaces();
$this->timestamp = wfTimestamp( TS_ISO_8601, wfTimestampNow() );
$user = $this->getOption( 'u', false );
$reason = $this->getOption( 'r', '' );
$interval = $this->getOption( 'i', 0 );
- $noredirects = $this->getOption( 'noredirects', false );
+ $noredirects = $this->hasOption( 'noredirects' );
if ( $this->hasArg() ) {
$file = fopen( $this->getArg(), 'r' );
} else {
public function execute() {
$ns = $this->getOption( 'ns', NS_MEDIAWIKI );
- $delete = $this->getOption( 'delete', false );
- $all = $this->getOption( 'all', false );
+ $delete = $this->hasOption( 'delete' );
+ $all = $this->hasOption( 'all' );
$dbw = $this->getDB( DB_MASTER );
$this->beginTransaction( $dbw, __METHOD__ );
public function execute() {
$name = $this->getArg();
- $delete = $this->getOption( 'delete', false );
+ $delete = $this->hasOption( 'delete' );
$dbw = $this->getDB( DB_MASTER );
$this->beginTransaction( $dbw, __METHOD__ );
public function execute() {
$begin = $this->getOption( 'begin', '' );
$throttle = $this->getOption( 'throttle', 0 );
- $force = $this->getOption( 'force', false );
+ $force = $this->hasOption( 'force' );
$dbw = $this->getDB( DB_MASTER );
}
public function execute() {
- $force = $this->getOption( 'force', false );
+ $force = $this->hasOption( 'force' );
$this->source = $this->getOption( 'source', 'https://en.wikipedia.org/w/api.php' );
$data = $this->fetchLinks();
$this->output( "Building content page file cache from page {$start}!\n" );
$dbr = $this->getDB( DB_REPLICA );
- $overwrite = $this->getOption( 'overwrite', false );
+ $overwrite = $this->hasOption( 'overwrite' );
$start = ( $start > 0 )
? $start
: $dbr->selectField( 'page', 'MIN(page_id)', false, __METHOD__ );
} elseif ( ( $category = $this->getOption( 'tracking-category', false ) ) !== false ) {
$this->refreshTrackingCategory( $category );
} elseif ( !$this->hasOption( 'dfn-only' ) ) {
- $new = $this->getOption( 'new-only', false );
- $redir = $this->getOption( 'redirects-only', false );
- $oldRedir = $this->getOption( 'old-redirects-only', false );
+ $new = $this->hasOption( 'new-only' );
+ $redir = $this->hasOption( 'redirects-only' );
+ $oldRedir = $this->hasOption( 'old-redirects-only' );
$this->doRefreshLinks( $start, $new, $end, $redir, $oldRedir );
$this->deleteLinksFromNonexistent( null, null, $this->mBatchSize, $dfnChunkSize );
} else {