From b02cfed1c4a696d37fa0193eb366dd6efae19f81 Mon Sep 17 00:00:00 2001 From: Kartik Mistry Date: Wed, 21 Feb 2018 18:06:54 +0530 Subject: [PATCH] Added option to continue script from particular User ID Change-Id: I0bdfab6585a110c30cc61c9b1129a08143ef2d4b --- maintenance/ULSCompactLinksDisablePref.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maintenance/ULSCompactLinksDisablePref.php b/maintenance/ULSCompactLinksDisablePref.php index 4eef7ba3..96195563 100644 --- a/maintenance/ULSCompactLinksDisablePref.php +++ b/maintenance/ULSCompactLinksDisablePref.php @@ -26,6 +26,8 @@ class ULSCompactLinksDisablePref extends Maintenance { $this->setBatchSize( 100 ); $this->addOption( 'really', 'Really change the preferences' ); + + $this->addOption( 'continue', 'Continue running from this user ID', false, true ); } public function execute() { @@ -33,7 +35,8 @@ class ULSCompactLinksDisablePref extends Maintenance { $this->really = $this->hasOption( 'really' ); - $lastUserId = 0; + $lastUserId = $this->getOption( 'continue', 0 ); + do { $tables = [ 'revision', 'user_properties', 'user_groups' ]; $fields = [ 'rev_user', 'isbot' => 'ug_group', 'hasbeta' => 'up_value' ];