88 if ( $item->getBits() & $bit ) {
109 $perItemStatus = isset(
$params[
'perItemStatus'] ) ?
$params[
'perItemStatus'] :
false;
114 $this->res = $this->
doQuery( $dbw );
116 $dbw->startAtomic( __METHOD__ );
119 $missing = array_flip( $this->ids );
122 $authorIds = $authorIPs = [];
124 if ( $perItemStatus ) {
133 unset( $missing[$item->getId()] );
135 if ( $perItemStatus ) {
136 $itemStatus = Status::newGood();
137 $status->itemStatuses[$item->getId()] = $itemStatus;
142 $oldBits = $item->getBits();
146 if ( $oldBits == $newBits ) {
147 $itemStatus->warning(
'revdelete-no-change', $item->formatDate(), $item->formatTime() );
150 } elseif ( $oldBits == 0 && $newBits != 0 ) {
152 } elseif ( $oldBits != 0 && $newBits == 0 ) {
158 if ( $item->isHideCurrentOp( $newBits ) ) {
160 $itemStatus->error(
'revdelete-hide-current', $item->formatDate(), $item->formatTime() );
164 if ( !$item->canView() ) {
166 $msg = ( $opType ==
'show' ) ?
167 'revdelete-show-no-access' :
'revdelete-modify-no-access';
168 $itemStatus->error( $msg, $item->formatDate(), $item->formatTime() );
174 $itemStatus->warning(
'revdelete-only-restricted', $item->formatDate(), $item->formatTime() );
180 $ok = $item->setBits( $newBits );
183 $idsForLog[] = $item->getId();
185 if ( $item->getAuthorId() > 0 ) {
186 $authorIds[] = $item->getAuthorId();
188 $authorIPs[] = $item->getAuthorName();
191 $itemStatus->error(
'revdelete-concurrent-change', $item->formatDate(), $item->formatTime() );
197 foreach ( $missing
as $id => $unused ) {
198 if ( $perItemStatus ) {
199 $status->itemStatuses[$id] = Status::newFatal(
'revdelete-modify-missing', $id );
201 $status->error(
'revdelete-modify-missing', $id );
206 if (
$status->successCount == 0 ) {
207 $dbw->rollback( __METHOD__ );
212 $successCount =
$status->successCount;
218 $dbw->rollback( __METHOD__ );
225 'title' => $this->
title,
226 'count' => $successCount,
227 'newBits' => $newBits,
228 'oldBits' => $oldBits,
231 'authorIds' => $authorIds,
232 'authorIPs' => $authorIPs
237 $dbw->onTransactionIdle(
function()
use ( $that ) {
238 $that->doPostCommitUpdates();
241 $dbw->endAtomic( __METHOD__ );
252 $this->res = $this->
doQuery( $dbw );
271 throw new MWException(
"Bad log URL param type!" );
275 $logType =
'suppress';
283 $logEntry->setTarget(
$params[
'title'] );
284 $logEntry->setComment(
$params[
'comment'] );
285 $logEntry->setParameters( $logParams );
286 $logEntry->setPerformer( $this->
getUser() );
288 $logEntry->setRelations( [
290 'target_author_id' =>
$params[
'authorIds'],
291 'target_author_ip' =>
$params[
'authorIPs'],
293 $logId = $logEntry->insert();
294 $logEntry->publish( $logId );
314 '6::ofield' =>
$params[
'oldBits'],
315 '7::nfield' =>
$params[
'newBits'],
332 return Status::newGood();
341 return Status::newGood();
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
getUser()
Get the User object.
static isIPAddress( $ip)
Determine if a string is as valid IP address or network (CIDR prefix).
Class for creating log entries manually, to inject them into the database.
Abstract base class for a list of deletable items.
setVisibility(array $params)
Set the visibility for the revisions in this list.
areAnySuppressed()
Indicate whether any item in this list is suppressed.
static suggestTarget( $target, array $ids)
Suggest a target for the revision deletion Optionally override this function.
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
doPostCommitUpdates()
A hook for setVisibility(): do any necessary updates post-commit.
__construct(IContextSource $context, Title $title, array $ids)
static getRestriction()
Get the user right required for this list type Override this function.
getLogAction()
Get the log action for this list type.
clearFileOps()
Clear any data structures needed for doPreCommitUpdates() and doPostCommitUpdates() STUB.
static getRelationType()
Get the DB field name associated with the ID list.
getSuppressBit()
Get the integer value of the flag used for suppression.
getLogParams( $params)
Get log parameter array.
updateLog( $params)
Record a log entry on the action.
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
reloadFromMaster()
Reload the list data from the master DB.
static getRelationType( $typeName)
Get DB field name for URL param... Future code for other things may also track other types of revisio...
static extractBitfield(array $bitPars, $oldfield)
Put together a rev_deleted bitfield.
List for revision table items for a single page.
getType()
Get the internal type name of this list.
current()
Get the current list item, or false if we are at the end.
doQuery( $db)
Do the DB query to iterate through the objects.
next()
Move the iteration pointer to the next list item, and return it.
Represents a title within MediaWiki.
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
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist 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
the array() calling protocol came about after MediaWiki 1.4rc1.
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
Interface for objects which can provide a MediaWiki context on request.