aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/attachLatest.php
diff options
context:
space:
mode:
authorNathan <nathanlarson3141@gmail.com>2014-03-12 07:41:10 -0400
committerNathan <nathanlarson3141@gmail.com>2014-03-12 07:46:09 -0400
commite2da0b4314229f1e8c7af182f6ec2dda1ae5ef42 (patch)
treee10921979649ab49ef17f69f02d83fce3c048058 /maintenance/attachLatest.php
parent32a8e1e6307d01cd81e0be6bd2c86f2e943ea187 (diff)
downloadmediawikicore-e2da0b4314229f1e8c7af182f6ec2dda1ae5ef42.tar.gz
mediawikicore-e2da0b4314229f1e8c7af182f6ec2dda1ae5ef42.zip
Add --regenerate-all option
Bug: 62565 Change-Id: I98e052120c4f64d6a11f8363fa17de9c69656183
Diffstat (limited to 'maintenance/attachLatest.php')
-rw-r--r--maintenance/attachLatest.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/maintenance/attachLatest.php b/maintenance/attachLatest.php
index 2cf277fe24f2..1e82dc14c58d 100644
--- a/maintenance/attachLatest.php
+++ b/maintenance/attachLatest.php
@@ -37,15 +37,21 @@ class AttachLatest extends Maintenance {
public function __construct() {
parent::__construct();
$this->addOption( "fix", "Actually fix the entries, will dry run otherwise" );
+ $this->addOption( "regenerate-all",
+ "Regenerate the page_latest field for all records in table page" );
$this->mDescription = "Fix page_latest entries in the page table";
}
public function execute() {
$this->output( "Looking for pages with page_latest set to 0...\n" );
$dbw = wfGetDB( DB_MASTER );
+ $conds = array( 'page_latest' => 0 );
+ if ( $this->hasOption( 'regenerate-all' ) ) {
+ $conds = '';
+ }
$result = $dbw->select( 'page',
array( 'page_id', 'page_namespace', 'page_title' ),
- array( 'page_latest' => 0 ),
+ $conds,
__METHOD__ );
$n = 0;