Go to the documentation of this file.
87 foreach ( $this
as $item ) {
88 if ( $item->getBits() & $bit ) {
113 $perItemStatus = isset(
$params[
'perItemStatus'] ) ?
$params[
'perItemStatus'] :
false;
118 $this->res = $this->
doQuery( $dbw );
125 $dbw->startAtomic( __METHOD__ );
126 $dbw->onTransactionResolution(
134 $missing = array_flip( $this->ids );
137 $authorIds = $authorIPs = [];
139 if ( $perItemStatus ) {
152 $visibilityChangeMap = [];
155 foreach ( $this
as $item ) {
156 unset( $missing[$item->getId()] );
158 if ( $perItemStatus ) {
160 $status->itemStatuses[$item->getId()] = $itemStatus;
165 $oldBits = $item->getBits();
169 if ( $oldBits == $newBits ) {
170 $itemStatus->warning(
171 'revdelete-no-change', $item->formatDate(), $item->formatTime() );
174 } elseif ( $oldBits == 0 && $newBits != 0 ) {
176 } elseif ( $oldBits != 0 && $newBits == 0 ) {
182 if ( $item->isHideCurrentOp( $newBits ) ) {
185 'revdelete-hide-current', $item->formatDate(), $item->formatTime() );
188 } elseif ( !$item->canView() ) {
190 $msg = ( $opType ==
'show' ) ?
191 'revdelete-show-no-access' :
'revdelete-modify-no-access';
192 $itemStatus->error( $msg, $item->formatDate(), $item->formatTime() );
197 $itemStatus->warning(
198 'revdelete-only-restricted', $item->formatDate(), $item->formatTime() );
204 $ok = $item->setBits( $newBits );
207 $idsForLog[] = $item->getId();
210 $logType =
'suppress';
213 $addedBits = ( $oldBits ^ $newBits ) & $newBits;
214 $removedBits = ( $oldBits ^ $newBits ) & $oldBits;
215 $virtualNewBits |= $addedBits;
216 $virtualOldBits |= $removedBits;
219 if ( $item->getAuthorId() > 0 ) {
220 $authorIds[] = $item->getAuthorId();
222 $authorIPs[] = $item->getAuthorName();
227 $visibilityChangeMap[$item->getId()] = [
228 'oldBits' => $oldBits,
229 'newBits' => $newBits,
233 'revdelete-concurrent-change', $item->formatDate(), $item->formatTime() );
239 foreach ( $missing
as $id => $unused ) {
240 if ( $perItemStatus ) {
243 $status->error(
'revdelete-modify-missing', $id );
248 if (
$status->successCount == 0 ) {
249 $dbw->endAtomic( __METHOD__ );
254 $successCount =
$status->successCount;
260 $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
261 $lbFactory->rollbackMasterChanges( __METHOD__ );
269 'title' => $this->
title,
270 'count' => $successCount,
271 'newBits' => $virtualNewBits,
272 'oldBits' => $virtualOldBits,
273 'comment' => $comment,
275 'authorIds' => $authorIds,
276 'authorIPs' => $authorIPs,
283 function ()
use ( $visibilityChangeMap ) {
290 $dbw->endAtomic( __METHOD__ );
298 foreach ( $this
as $item ) {
299 $status->merge( $item->lock() );
308 foreach ( $this
as $item ) {
309 $status->merge( $item->unlock() );
321 $this->res = $this->
doQuery( $dbw );
342 throw new MWException(
"Bad log URL param type!" );
348 $logEntry->setTarget(
$params[
'title'] );
349 $logEntry->setComment(
$params[
'comment'] );
350 $logEntry->setParameters( $logParams );
351 $logEntry->setPerformer( $this->
getUser() );
353 $logEntry->setRelations( [
355 'target_author_id' =>
$params[
'authorIds'],
356 'target_author_ip' =>
$params[
'authorIPs'],
359 $logEntry->setTags(
$params[
'tags'] );
360 $logId = $logEntry->insert();
361 $logEntry->publish( $logId );
381 '6::ofield' =>
$params[
'oldBits'],
382 '7::nfield' =>
$params[
'newBits'],
getSuppressBit()
Get the integer value of the flag used for suppression.
__construct(IContextSource $context, Title $title, array $ids)
List for revision table items for a single page.
clearFileOps()
Clear any data structures needed for doPreCommitUpdates() and doPostCommitUpdates() STUB.
updateLog( $logType, $params)
Record a log entry on the action.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
getLogParams( $params)
Get log parameter array.
static newFatal( $message)
Factory function for fatal errors.
reloadFromMaster()
Reload the list data from the master DB.
getUser()
Get the User object.
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
setVisibility(array $params)
Set the visibility for the revisions in this list.
static addCallableUpdate( $callable, $stage=self::POSTSEND, IDatabase $dbw=null)
Add a callable update.
doQuery( $db)
Do the DB query to iterate through the objects.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
Abstract base class for a list of deletable items.
areAnySuppressed()
Indicate whether any item in this list is suppressed.
static getRelationType()
Get the DB field name associated with the ID list.
static newGood( $value=null)
Factory function for good results.
getLogAction()
Get the log action for this list type.
static getRestriction()
Get the user right required for this list type Override this function.
Interface for objects which can provide a MediaWiki context on request.
Represents a title within MediaWiki.
static suggestTarget( $target, array $ids)
Suggest a target for the revision deletion Optionally override this function.
static getRelationType( $typeName)
Get DB field name for URL param...
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
getType()
Get the internal type name of this list.
Class for creating log entries manually, to inject them into the database.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
static extractBitfield(array $bitPars, $oldfield)
Put together a rev_deleted bitfield.
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
static isIPAddress( $ip)
Determine if a string is as valid IP address or network (CIDR prefix).
the array() calling protocol came about after MediaWiki 1.4rc1.