12require_once __DIR__ .
'/Maintenance.php';
17 parent::__construct();
19 $this->
addArg(
'tag name',
'Name of the tag to delete' );
26 $defStore = $services->getChangeTagDefStore();
30 $tagId = $defStore->getId( $tag );
36 if ( !$status->isOK() ) {
40 $this->
output(
"Deleting tag '$tag'...\n" );
44 $dbw->newUpdateQueryBuilder()
45 ->update(
'change_tag_def' )
47 'ctd_user_defined' => 0,
50 ->where( [
'ctd_id' => $tagId ] )
51 ->caller( __METHOD__ )->execute();
57 $ids = $dbw->newSelectQueryBuilder()
59 ->from(
'change_tag' )
60 ->where( [
'ct_tag_id' => $tagId ] )
62 ->caller( __METHOD__ )
68 $dbw->newDeleteQueryBuilder()
69 ->deleteFrom(
'change_tag' )
70 ->where( [
'ct_id' => $ids ] )
71 ->caller( __METHOD__ )->execute();
72 $count += $dbw->affectedRows();
73 $this->
output(
"$count\n" );
76 $this->
output(
"The tag has been removed from $count revisions, deleting the tag itself...\n" );
79 $this->
output(
"Done.\n" );
85require_once RUN_MAINTENANCE_IF_MAIN;
__construct()
Default constructor.
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addArg( $arg, $description, $required=true, $multi=false)
Add some args that are needed.
getArg( $argId=0, $default=null)
Get an argument.
getBatchSize()
Returns batch size.
output( $out, $channel=null)
Throw some output to the user.
fatalError( $msg, $exitCode=1)
Output a message and terminate the current script.
waitForReplication()
Wait for replica DB servers to catch up.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.