MediaWiki
1.29.2
|
Static Public Member Functions | |
static | activateTagWithChecks ( $tag, $reason, User $user, $ignoreWarnings=false, array $logEntryTags=[]) |
Activates a tag, checking whether it is allowed first, and adding a log entry afterwards. More... | |
static | addTags ( $tags, $rc_id=null, $rev_id=null, $log_id=null, $params=null, RecentChange $rc=null) |
Add tags to a change given its rc_id, rev_id and/or log_id. More... | |
static | addTagsAccompanyingChangeWithChecks (array $tags, $rc_id, $rev_id, $log_id, $params, User $user) |
Adds tags to a given change, checking whether it is allowed first, but without adding a log entry. More... | |
static | buildTagFilterSelector ( $selected='', $ooui=false, IContextSource $context=null) |
Build a text box to select a change tag. More... | |
static | canActivateTag ( $tag, User $user=null) |
Is it OK to allow the user to activate this tag? More... | |
static | canAddTagsAccompanyingChange (array $tags, User $user=null) |
Is it OK to allow the user to apply all the specified tags at the same time as they edit/make the change? More... | |
static | canCreateTag ( $tag, User $user=null) |
Is it OK to allow the user to create this tag? More... | |
static | canDeactivateTag ( $tag, User $user=null) |
Is it OK to allow the user to deactivate this tag? More... | |
static | canDeleteTag ( $tag, User $user=null) |
Is it OK to allow the user to delete this tag? More... | |
static | canUpdateTags (array $tagsToAdd, array $tagsToRemove, User $user=null) |
Is it OK to allow the user to adds and remove the given tags tags to/from a change? More... | |
static | createTagWithChecks ( $tag, $reason, User $user, $ignoreWarnings=false, array $logEntryTags=[]) |
Creates a tag by adding a row to the valid_tag table. More... | |
static | deactivateTagWithChecks ( $tag, $reason, User $user, $ignoreWarnings=false, array $logEntryTags=[]) |
Deactivates a tag, checking whether it is allowed first, and adding a log entry afterwards. More... | |
static | defineTag ( $tag) |
Defines a tag in the valid_tag table, without checking that the tag name is valid. More... | |
static | deleteTagEverywhere ( $tag) |
Permanently removes all traces of a tag from the DB. More... | |
static | deleteTagWithChecks ( $tag, $reason, User $user, $ignoreWarnings=false, array $logEntryTags=[]) |
Deletes a tag, checking whether it is allowed first, and adding a log entry afterwards. More... | |
static | formatSummaryRow ( $tags, $page, IContextSource $context=null) |
Creates HTML for the given tags. More... | |
static | listDefinedTags () |
Basically lists defined tags which count even if they aren't applied to anything. More... | |
static | listExplicitlyDefinedTags () |
Lists tags explicitly defined in the valid_tag table of the database. More... | |
static | listExtensionActivatedTags () |
static | listExtensionDefinedTags () |
Call listSoftwareDefinedTags directly. More... | |
static | listSoftwareActivatedTags () |
Lists those tags which core or extensions report as being "active". More... | |
static | listSoftwareDefinedTags () |
Lists tags defined by core or extensions using the ListDefinedTags hook. More... | |
static | modifyDisplayQuery (&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag=false) |
Applies all tags-related changes to a query. More... | |
static | purgeTagCacheAll () |
Invalidates the short-term cache of defined tags used by the list*DefinedTags functions, as well as the tag statistics cache. More... | |
static | purgeTagUsageCache () |
Invalidates the tag statistics cache only. More... | |
static | showTagEditingUI (User $user) |
Indicate whether change tag editing UI is relevant. More... | |
static | tagDescription ( $tag, IContextSource $context) |
Get a short description for a tag. More... | |
static | tagUsageStatistics () |
Returns a map of any tags used on the wiki to number of edits tagged with them, ordered descending by the hitcount. More... | |
static | undefineTag ( $tag) |
Removes a tag from the valid_tag table. More... | |
static | updateTags ( $tagsToAdd, $tagsToRemove, &$rc_id=null, &$rev_id=null, &$log_id=null, $params=null, RecentChange $rc=null, User $user=null) |
Add and remove tags to/from a change given its rc_id, rev_id and/or log_id, without verifying that the tags exist or are valid. More... | |
static | updateTagsWithChecks ( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id, $log_id, $params, $reason, User $user) |
Adds and/or removes tags to/from a given change, checking whether it is allowed first, and adding a log entry afterwards. More... | |
Public Attributes | |
const | MAX_DELETE_USES = 5000 |
Can't delete tags with more than this many uses. More... | |
Static Protected Member Functions | |
static | logTagManagementAction ( $action, $tag, $reason, User $user, $tagCount=null, array $logEntryTags=[]) |
Writes a tag action into the tag management log. More... | |
static | restrictedTagError ( $msgOne, $msgMulti, $tags) |
Helper function to generate a fatal status with a 'not-allowed' type error. More... | |
static | updateTagSummaryRow (&$tagsToAdd, &$tagsToRemove, $rc_id, $rev_id, $log_id, &$prevTags=[]) |
Adds or removes a given set of tags to/from the relevant row of the tag_summary table. More... | |
Static Private Attributes | |
static string[] | $coreTags = [ 'mw-contentmodelchange' ] |
Definition at line 26 of file ChangeTags.php.
|
static |
Activates a tag, checking whether it is allowed first, and adding a log entry afterwards.
Includes a call to ChangeTag::canActivateTag(), so your code doesn't need to do that.
string | $tag | |
string | $reason | |
User | $user | Who to give credit for the action |
bool | $ignoreWarnings | Can be used for API interaction, default false |
array | $logEntryTags | Change tags to apply to the entry that will be created in the tag management log |
Definition at line 844 of file ChangeTags.php.
References $tag, $user, canActivateTag(), defineTag(), logTagManagementAction(), and StatusValue\newGood().
|
static |
Add tags to a change given its rc_id, rev_id and/or log_id.
string | string[] | $tags | Tags to add to the change |
int | null | $rc_id | The rc_id of the change to add the tags to |
int | null | $rev_id | The rev_id of the change to add the tags to |
int | null | $log_id | The log_id of the change to add the tags to |
string | $params | Params to put in the ct_params field of table 'change_tag' |
RecentChange | null | $rc | Recent change, in case the tagging accompanies the action (this should normally be the case) |
MWException |
Definition at line 136 of file ChangeTags.php.
References $params, and updateTags().
Referenced by addTagsAccompanyingChangeWithChecks(), MovePage\moveToInternal(), ApiTag\processIndividual(), and RecentChange\save().
|
static |
Adds tags to a given change, checking whether it is allowed first, but without adding a log entry.
Useful for cases where the tag is being added along with the action that generated the change (e.g. tagging an edit as it is being made).
Extensions should not use this function, unless directly handling a user request to add a particular tag. Normally, extensions should call ChangeTags::updateTags() instead.
array | $tags | Tags to apply |
int | null | $rc_id | The rc_id of the change to add the tags to |
int | null | $rev_id | The rev_id of the change to add the tags to |
int | null | $log_id | The log_id of the change to add the tags to |
string | $params | Params to put in the ct_params field of table 'change_tag' when adding tags |
User | $user | Who to give credit for the action |
Definition at line 438 of file ChangeTags.php.
References $params, $user, addTags(), canAddTagsAccompanyingChange(), and StatusValue\newGood().
|
static |
Build a text box to select a change tag.
string | $selected | Tag to select by default |
bool | $ooui | Use an OOUI TextInputWidget as selector instead of a non-OOUI input field You need to call OutputPage::enableOOUI() yourself. |
IContextSource | null | $context |
Definition at line 678 of file ChangeTags.php.
References $context, captcha-old\count, ContextSource\getConfig(), RequestContext\getMain(), Xml\input(), ContextSource\msg(), and Html\rawElement().
Referenced by HTMLTagFilter\getDiv(), SpecialRecentChanges\getExtraOptions(), HTMLTagFilter\getTableRow(), HistoryAction\onView(), and LogEventsList\showOptions().
|
static |
Is it OK to allow the user to activate this tag?
string | $tag | Tag that you are interested in activating |
User | null | $user | User whose permission you wish to check, or null if you don't care (e.g. maintenance scripts) |
Definition at line 801 of file ChangeTags.php.
References $tag, $user, listDefinedTags(), StatusValue\newFatal(), StatusValue\newGood(), and tagUsageStatistics().
Referenced by activateTagWithChecks(), and SpecialTags\doTagRow().
Is it OK to allow the user to apply all the specified tags at the same time as they edit/make the change?
array | $tags | Tags that you are interested in applying |
User | null | $user | User whose permission you wish to check, or null if you don't care (e.g. maintenance scripts) |
Definition at line 395 of file ChangeTags.php.
References $user, listExplicitlyDefinedTags(), StatusValue\newFatal(), StatusValue\newGood(), and restrictedTagError().
Referenced by addTagsAccompanyingChangeWithChecks(), ApiImageRotate\execute(), ApiManageTags\execute(), ApiTag\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiImport\execute(), ApiPatrol\execute(), ApiEditPage\execute(), ApiUnblock\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiRollback\execute(), ApiUserrights\execute(), ApiSetPageLanguage\execute(), ApiBase\getParameterFromSettings(), EditPage\internalAttemptSave(), ApiUpload\performUpload(), and SpecialUpload\processUpload().
|
static |
Is it OK to allow the user to create this tag?
string | $tag | Tag that you are interested in creating |
User | null | $user | User whose permission you wish to check, or null if you don't care (e.g. maintenance scripts) |
Definition at line 936 of file ChangeTags.php.
References $tag, $title, $user, Title\makeTitleSafe(), StatusValue\newFatal(), StatusValue\newGood(), NS_MEDIAWIKI, Hooks\run(), and tagUsageStatistics().
Referenced by createTagWithChecks().
|
static |
Is it OK to allow the user to deactivate this tag?
string | $tag | Tag that you are interested in deactivating |
User | null | $user | User whose permission you wish to check, or null if you don't care (e.g. maintenance scripts) |
Definition at line 873 of file ChangeTags.php.
References $tag, $user, listExplicitlyDefinedTags(), StatusValue\newFatal(), and StatusValue\newGood().
Referenced by deactivateTagWithChecks(), and SpecialTags\doTagRow().
|
static |
Is it OK to allow the user to delete this tag?
string | $tag | Tag that you are interested in deleting |
User | null | $user | User whose permission you wish to check, or null if you don't care (e.g. maintenance scripts) |
Definition at line 1071 of file ChangeTags.php.
References $status, $tag, $user, listSoftwareDefinedTags(), StatusValue\newFatal(), StatusValue\newGood(), Hooks\run(), and tagUsageStatistics().
Referenced by deleteTagWithChecks(), SpecialTags\doTagRow(), and SpecialTags\showDeleteTagForm().
|
static |
Is it OK to allow the user to adds and remove the given tags tags to/from a change?
array | $tagsToAdd | Tags that you are interested in adding |
array | $tagsToRemove | Tags that you are interested in removing |
User | null | $user | User whose permission you wish to check, or null if you don't care (e.g. maintenance scripts) |
Definition at line 466 of file ChangeTags.php.
References $user, listExplicitlyDefinedTags(), listSoftwareDefinedTags(), StatusValue\newFatal(), StatusValue\newGood(), and restrictedTagError().
Referenced by updateTagsWithChecks().
|
static |
Creates a tag by adding a row to the valid_tag
table.
Includes a call to ChangeTag::canDeleteTag(), so your code doesn't need to do that.
string | $tag | |
string | $reason | |
User | $user | Who to give credit for the action |
bool | $ignoreWarnings | Can be used for API interaction, default false |
array | $logEntryTags | Change tags to apply to the entry that will be created in the tag management log |
Definition at line 990 of file ChangeTags.php.
References $tag, $user, canCreateTag(), defineTag(), logTagManagementAction(), and StatusValue\newGood().
Referenced by SpecialTags\processCreateTagForm().
|
static |
Deactivates a tag, checking whether it is allowed first, and adding a log entry afterwards.
Includes a call to ChangeTag::canDeactivateTag(), so your code doesn't need to do that.
string | $tag | |
string | $reason | |
User | $user | Who to give credit for the action |
bool | $ignoreWarnings | Can be used for API interaction, default false |
array | $logEntryTags | Change tags to apply to the entry that will be created in the tag management log |
Definition at line 907 of file ChangeTags.php.
References $tag, $user, canDeactivateTag(), logTagManagementAction(), StatusValue\newGood(), and undefineTag().
|
static |
Defines a tag in the valid_tag table, without checking that the tag name is valid.
Extensions should NOT use this function; they can use the ListDefinedTags hook instead.
string | $tag | Tag to create |
Definition at line 726 of file ChangeTags.php.
References $tag, DB_MASTER, purgeTagCacheAll(), and wfGetDB().
Referenced by activateTagWithChecks(), and createTagWithChecks().
|
static |
Permanently removes all traces of a tag from the DB.
Good for removing misspelt or temporary tags.
This function should be directly called by maintenance scripts only, never by user-facing code. See deleteTagWithChecks() for functionality that can safely be exposed to users.
string | $tag | Tag to remove |
Definition at line 1022 of file ChangeTags.php.
References $status, $tag, as, DB_MASTER, StatusValue\newGood(), purgeTagCacheAll(), Hooks\run(), undefineTag(), updateTagSummaryRow(), wfDebug(), and wfGetDB().
Referenced by deleteTagWithChecks().
|
static |
Deletes a tag, checking whether it is allowed first, and adding a log entry afterwards.
Includes a call to ChangeTag::canDeleteTag(), so your code doesn't need to do that.
string | $tag | |
string | $reason | |
User | $user | Who to give credit for the action |
bool | $ignoreWarnings | Can be used for API interaction, default false |
array | $logEntryTags | Change tags to apply to the entry that will be created in the tag management log |
Definition at line 1121 of file ChangeTags.php.
References $tag, $user, canDeleteTag(), deleteTagEverywhere(), logTagManagementAction(), and tagUsageStatistics().
|
static |
Creates HTML for the given tags.
string | $tags | Comma-separated list of tags |
string | $page | A label for the type of action which is being displayed, for example: 'history', 'contributions' or 'newpages' |
IContextSource | null | $context |
Definition at line 52 of file ChangeTags.php.
References $context, $tag, as, captcha-old\count, ContextSource\getLanguage(), RequestContext\getMain(), ContextSource\msg(), tagDescription(), and Xml\tags().
Referenced by SpecialUndelete\diffHeader(), SpecialUndelete\formatRevisionRow(), SpecialNewpages\formatRow(), ContribsPager\formatRow(), ChangeTagsRevisionItem\getHTML(), ChangeTagsLogItem\getHTML(), RevDelRevisionItem\getHTML(), HistoryPager\historyLine(), ChangesList\insertTags(), LogEventsList\logLine(), and DifferenceEngine\showDiffPage().
|
static |
Basically lists defined tags which count even if they aren't applied to anything.
It returns a union of the results of listExplicitlyDefinedTags() and listExtensionDefinedTags().
Definition at line 1196 of file ChangeTags.php.
References listExplicitlyDefinedTags(), and listSoftwareDefinedTags().
Referenced by canActivateTag(), and ApiFeedContributions\getAllowedParams().
|
static |
Lists tags explicitly defined in the valid_tag
table of the database.
Tags in table 'change_tag' which are not in table 'valid_tag' are not included.
Tries memcached first.
Definition at line 1212 of file ChangeTags.php.
References $dbr, $fname, array(), DB_REPLICA, ObjectCache\getMainWANInstance(), IExpiringStore\TTL_MINUTE, IExpiringStore\TTL_PROC_LONG, use, wfGetDB(), and wfMemcKey().
Referenced by canAddTagsAccompanyingChange(), canDeactivateTag(), canUpdateTags(), ApiQueryTags\execute(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), SpecialEditTags\getTagSelect(), listDefinedTags(), and SpecialTags\showTagList().
|
static |
Definition at line 1184 of file ChangeTags.php.
References listSoftwareActivatedTags(), and wfDeprecated().
|
static |
Call listSoftwareDefinedTags directly.
Definition at line 1273 of file ChangeTags.php.
References listSoftwareDefinedTags(), and wfDeprecated().
|
static |
Lists those tags which core or extensions report as being "active".
Definition at line 1155 of file ChangeTags.php.
References $coreTags, array(), DB_REPLICA, ObjectCache\getMainWANInstance(), Hooks\isRegistered(), Hooks\run(), IExpiringStore\TTL_MINUTE, IExpiringStore\TTL_PROC_LONG, use, wfGetDB(), and wfMemcKey().
Referenced by ApiQueryTags\execute(), listExtensionActivatedTags(), SpecialTags\showDeleteTagForm(), and SpecialTags\showTagList().
|
static |
Lists tags defined by core or extensions using the ListDefinedTags hook.
Extensions need only define those tags they deem to be in active use.
Tries memcached first.
Definition at line 1244 of file ChangeTags.php.
References $coreTags, array(), DB_REPLICA, ObjectCache\getMainWANInstance(), Hooks\isRegistered(), Hooks\run(), IExpiringStore\TTL_MINUTE, IExpiringStore\TTL_PROC_LONG, use, wfGetDB(), and wfMemcKey().
Referenced by canDeleteTag(), canUpdateTags(), ApiQueryTags\execute(), listDefinedTags(), listExtensionDefinedTags(), and SpecialTags\showTagList().
|
staticprotected |
Writes a tag action into the tag management log.
string | $action | |
string | $tag | |
string | $reason | |
User | $user | Who to attribute the action to |
int | $tagCount | For deletion only, how many usages the tag had before it was deleted. |
array | $logEntryTags | Change tags to apply to the entry that will be created in the tag management log |
Definition at line 767 of file ChangeTags.php.
References $params, $tag, $user, DB_MASTER, Title\newFromText(), and wfGetDB().
Referenced by activateTagWithChecks(), createTagWithChecks(), deactivateTagWithChecks(), and deleteTagWithChecks().
|
static |
Applies all tags-related changes to a query.
Handles selecting tags, and filtering. Needs $tables to be set up properly, so we can figure out which join conditions to use.
string | array | $tables | Table names, see Database::select |
string | array | $fields | Fields used in query, see Database::select |
string | array | $conds | Conditions used in query, see Database::select |
array | $join_conds | Join conditions, see Database::select |
array | $options | Options, see Database::select |
bool | string | $filter_tag | Tag to select on |
MWException | When unable to determine appropriate JOIN condition for tagging |
Definition at line 632 of file ChangeTags.php.
References $tables, $wgRequest, DB_REPLICA, global, and wfGetDB().
Referenced by SpecialRecentChangesLinked\doMainQuery(), SpecialRecentChanges\doMainQuery(), SpecialWatchlist\doMainQuery(), ChangesListSpecialPage\doMainQuery(), ChangeTagsLogList\doQuery(), ChangeTagsRevisionList\doQuery(), RevDelArchiveList\doQuery(), RevDelRevisionList\doQuery(), NewPagesPager\getQueryInfo(), ContribsPager\getQueryInfo(), LogPager\getQueryInfo(), HistoryPager\getQueryInfo(), and PageArchive\listRevisions().
|
static |
Invalidates the short-term cache of defined tags used by the list*DefinedTags functions, as well as the tag statistics cache.
Definition at line 1283 of file ChangeTags.php.
References $cache, ObjectCache\getMainWANInstance(), purgeTagUsageCache(), and wfMemcKey().
Referenced by defineTag(), deleteTagEverywhere(), and undefineTag().
|
static |
Invalidates the tag statistics cache only.
Definition at line 1297 of file ChangeTags.php.
References $cache, ObjectCache\getMainWANInstance(), and wfMemcKey().
Referenced by purgeTagCacheAll(), and updateTags().
|
staticprotected |
Helper function to generate a fatal status with a 'not-allowed' type error.
string | $msgOne | Message key to use in the case of one tag |
string | $msgMulti | Message key to use in the case of more than one tag |
array | $tags | Restricted tags (passed as $1 into the message, count of $tags passed as $2) |
Definition at line 378 of file ChangeTags.php.
References $lang, captcha-old\count, RequestContext\getMain(), and StatusValue\newFatal().
Referenced by canAddTagsAccompanyingChange(), and canUpdateTags().
|
static |
Indicate whether change tag editing UI is relevant.
Returns true if the user has the necessary right and there are any editable tags defined.
This intentionally doesn't check "any addable || any deletable", because it seems like it would be more confusing than useful if the checkboxes suddenly showed up because some abuse filter stopped defining a tag and then suddenly disappeared when someone deleted all uses of that tag.
User | $user |
Definition at line 1360 of file ChangeTags.php.
References $user.
Referenced by LogEventsList\__construct(), HistoryPager\__construct(), and SpecialLog\getActionButtons().
|
static |
Get a short description for a tag.
Checks if message key "mediawiki:tag-$tag" exists. If it does not, returns the HTML-escaped tag name. Uses the message if the message exists, provided it is not disabled. If the message is disabled, we consider the tag hidden, and return false.
string | $tag | Tag |
IContextSource | $context |
Definition at line 107 of file ChangeTags.php.
References $context, $tag, and ContextSource\msg().
Referenced by SpecialTags\doTagRow(), ApiQueryTags\execute(), and formatSummaryRow().
|
static |
Returns a map of any tags used on the wiki to number of edits tagged with them, ordered descending by the hitcount.
This does not include tags defined somewhere that have never been applied.
Keeps a short-term cache in memory, so calling this multiple times in the same request should be fine.
Definition at line 1313 of file ChangeTags.php.
References $dbr, $fname, $out, $res, array(), as, DB_REPLICA, ObjectCache\getMainWANInstance(), IExpiringStore\TTL_MINUTE, IExpiringStore\TTL_PROC_LONG, use, wfGetDB(), and wfMemcKey().
Referenced by canActivateTag(), canCreateTag(), canDeleteTag(), deleteTagWithChecks(), SpecialTags\showDeleteTagForm(), and SpecialTags\showTagList().
|
static |
Removes a tag from the valid_tag table.
The tag may remain in use by extensions, and may still show up as 'defined' if an extension is setting it from the ListDefinedTags hook.
string | $tag | Tag to remove |
Definition at line 745 of file ChangeTags.php.
References $tag, DB_MASTER, purgeTagCacheAll(), and wfGetDB().
Referenced by deactivateTagWithChecks(), and deleteTagEverywhere().
|
static |
Add and remove tags to/from a change given its rc_id, rev_id and/or log_id, without verifying that the tags exist or are valid.
If a tag is present in both $tagsToAdd and $tagsToRemove, it will be removed.
This function should only be used by extensions to manipulate tags they have registered using the ListDefinedTags hook. When dealing with user input, call updateTagsWithChecks() instead.
string | array | null | $tagsToAdd | Tags to add to the change |
string | array | null | $tagsToRemove | Tags to remove from the change |
int | null | &$rc_id | The rc_id of the change to add the tags to. Pass a variable whose value is null if the rc_id is not relevant or unknown. |
int | null | &$rev_id | The rev_id of the change to add the tags to. Pass a variable whose value is null if the rev_id is not relevant or unknown. |
int | null | &$log_id | The log_id of the change to add the tags to. Pass a variable whose value is null if the log_id is not relevant or unknown. |
string | $params | Params to put in the ct_params field of table 'change_tag' when adding tags |
RecentChange | null | $rc | Recent change being tagged, in case the tagging accompanies the action |
User | null | $user | Tagging user, in case the tagging is subsequent to the tagged action |
MWException | When $rc_id, $rev_id and $log_id are all null |
Definition at line 173 of file ChangeTags.php.
References $params, $tag, $user, array(), as, captcha-old\count, DB_MASTER, purgeTagUsageCache(), Hooks\run(), and wfGetDB().
Referenced by addTags(), and updateTagsWithChecks().
|
staticprotected |
Adds or removes a given set of tags to/from the relevant row of the tag_summary table.
Modifies the tagsToAdd and tagsToRemove arrays to reflect the tags that were actually added and/or removed.
array | &$tagsToAdd | |
array | &$tagsToRemove | If a tag is present in both $tagsToAdd and $tagsToRemove, it will be removed |
int | null | $rc_id | Null if not known or not applicable |
int | null | $rev_id | Null if not known or not applicable |
int | null | $log_id | Null if not known or not applicable |
array | &$prevTags | Optionally outputs a list of the tags that were in the tag_summary row to begin with |
Definition at line 318 of file ChangeTags.php.
References DB_MASTER, and wfGetDB().
Referenced by deleteTagEverywhere().
|
static |
Adds and/or removes tags to/from a given change, checking whether it is allowed first, and adding a log entry afterwards.
Includes a call to ChangeTag::canUpdateTags(), so your code doesn't need to do that. However, it doesn't check whether the *_id parameters are a valid combination. That is up to you to enforce. See ApiTag::execute() for an example.
array | null | $tagsToAdd | If none, pass array() or null |
array | null | $tagsToRemove | If none, pass array() or null |
int | null | $rc_id | The rc_id of the change to add the tags to |
int | null | $rev_id | The rev_id of the change to add the tags to |
int | null | $log_id | The log_id of the change to add the tags to |
string | $params | Params to put in the ct_params field of table 'change_tag' when adding tags |
string | $reason | Comment for the log |
User | $user | Who to give credit for the action |
Definition at line 529 of file ChangeTags.php.
References $params, $rev, $user, canUpdateTags(), captcha-old\count, DB_MASTER, SpecialPage\getTitleFor(), list, StatusValue\newFatal(), Revision\newFromId(), StatusValue\newGood(), RevDelLogList\suggestTarget(), updateTags(), and wfGetDB().
Referenced by ApiTag\processIndividual(), ChangeTagsLogList\updateChangeTagsOnAll(), and ChangeTagsRevisionList\updateChangeTagsOnAll().
|
staticprivate |
Definition at line 37 of file ChangeTags.php.
Referenced by listSoftwareActivatedTags(), and listSoftwareDefinedTags().
const ChangeTags::MAX_DELETE_USES = 5000 |
Can't delete tags with more than this many uses.
Similar in intent to the bigdelete user right
Definition at line 32 of file ChangeTags.php.