43 if ( !$userId || ( $op !==
'|' && $op !==
'&' ) ) {
50 # To suppress, we OR the current bitfields with Revision::DELETED_USER
51 # to put a 1 in the username *_deleted bit. To unsuppress we AND the
52 # current bitfields with the inverse of Revision::DELETED_USER. The
53 # username bit is made to 0 (x & 0 = 0), while others are unchanged (x & 1 = x).
54 # The same goes for the sysop-restricted *_deleted bit.
58 $delUser = $dbw->bitNot( $delUser );
59 $delAction = $dbw->bitNot( $delAction );
64 $userDbKey = $userTitle->getDBkey();
66 # Hide name from live edits
69 [ self::buildSetBitDeletedField(
'rev_deleted', $op, $delUser, $dbw ) ],
70 [
'rev_user' => $userId ],
73 # Hide name from deleted edits
76 [ self::buildSetBitDeletedField(
'ar_deleted', $op, $delUser, $dbw ) ],
77 [
'ar_user_text' =>
$name ],
84 [ self::buildSetBitDeletedField(
'log_deleted', $op, $delUser, $dbw ) ],
85 [
'log_user' => $userId,
'log_type != ' . $dbw->addQuotes(
'suppress' ) ],
90 [ self::buildSetBitDeletedField(
'log_deleted', $op, $delAction, $dbw ) ],
91 [
'log_namespace' =>
NS_USER,
'log_title' => $userDbKey,
92 'log_type != ' . $dbw->addQuotes(
'suppress' ) ],
99 [ self::buildSetBitDeletedField(
'rc_deleted', $op, $delUser, $dbw ) ],
100 [
'rc_user_text' =>
$name ],
105 [ self::buildSetBitDeletedField(
'rc_deleted', $op, $delAction, $dbw ) ],
106 [
'rc_namespace' =>
NS_USER,
'rc_title' => $userDbKey,
'rc_logid > 0' ],
110 # Hide name from live images
113 [ self::buildSetBitDeletedField(
'oi_deleted', $op, $delUser, $dbw ) ],
114 [
'oi_user_text' =>
$name ],
118 # Hide name from deleted images
121 [ self::buildSetBitDeletedField(
'fa_deleted', $op, $delUser, $dbw ) ],
122 [
'fa_user_text' =>
$name ],
130 return $field .
' = ' . ( $op ===
'&'
131 ? $dbw->bitAnd( $field,
$value )
132 : $dbw->bitOr( $field,
$value ) );
136 return self::setUsernameBitfields(
$name, $userId,
'|', $dbw );
140 return self::setUsernameBitfields(
$name, $userId,
'&', $dbw );
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
static suppressUserName($name, $userId, $dbw=null)
static unsuppressUserName($name, $userId, $dbw=null)
static buildSetBitDeletedField($field, $op, $value, $dbw)
Backend functions for suppressing and unsuppressing all references to a given user, used when blocking with HideUser enabled.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
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
static setUsernameBitfields($name, $userId, $op, $dbw)
Update *_deleted bitfields in various tables to hide or unhide usernames.
Basic database interface for live and lazy-loaded relation database handles.
Allows to change the fields on the form that will be generated $name