Added option to continue script from particular User ID

Change-Id: I0bdfab6585a110c30cc61c9b1129a08143ef2d4b
This commit is contained in:
Kartik Mistry
2018-02-21 18:06:54 +05:30
parent 7a6c973f16
commit b02cfed1c4

View File

@@ -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' ];