MediaWiki  1.32.0
UsersPager.php
Go to the documentation of this file.
1 <?php
33 class UsersPager extends AlphabeticPager {
34 
38  protected $userGroupCache;
39 
46  function __construct( IContextSource $context = null, $par = null, $including = null ) {
47  if ( $context ) {
48  $this->setContext( $context );
49  }
50 
51  $request = $this->getRequest();
52  $par = ( $par !== null ) ? $par : '';
53  $parms = explode( '/', $par );
54  $symsForAll = [ '*', 'user' ];
55 
56  if ( $parms[0] != '' &&
57  ( in_array( $par, User::getAllGroups() ) || in_array( $par, $symsForAll ) )
58  ) {
59  $this->requestedGroup = $par;
60  $un = $request->getText( 'username' );
61  } elseif ( count( $parms ) == 2 ) {
62  $this->requestedGroup = $parms[0];
63  $un = $parms[1];
64  } else {
65  $this->requestedGroup = $request->getVal( 'group' );
66  $un = ( $par != '' ) ? $par : $request->getText( 'username' );
67  }
68 
69  if ( in_array( $this->requestedGroup, $symsForAll ) ) {
70  $this->requestedGroup = '';
71  }
72  $this->editsOnly = $request->getBool( 'editsOnly' );
73  $this->temporaryGroupsOnly = $request->getBool( 'temporaryGroupsOnly' );
74  $this->creationSort = $request->getBool( 'creationSort' );
75  $this->including = $including;
76  $this->mDefaultDirection = $request->getBool( 'desc' )
79 
80  $this->requestedUser = '';
81 
82  if ( $un != '' ) {
84 
85  if ( !is_null( $username ) ) {
86  $this->requestedUser = $username->getText();
87  }
88  }
89 
90  parent::__construct();
91  }
92 
96  function getIndexField() {
97  return $this->creationSort ? 'user_id' : 'user_name';
98  }
99 
103  function getQueryInfo() {
104  $dbr = wfGetDB( DB_REPLICA );
105  $conds = [];
106 
107  // Don't show hidden names
108  if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
109  $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
110  }
111 
112  $options = [];
113 
114  if ( $this->requestedGroup != '' || $this->temporaryGroupsOnly ) {
115  $conds[] = 'ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ) .
116  ( !$this->temporaryGroupsOnly ? ' OR ug_expiry IS NULL' : '' );
117  }
118 
119  if ( $this->requestedGroup != '' ) {
120  $conds['ug_group'] = $this->requestedGroup;
121  }
122 
123  if ( $this->requestedUser != '' ) {
124  # Sorted either by account creation or name
125  if ( $this->creationSort ) {
126  $conds[] = 'user_id >= ' . intval( User::idFromName( $this->requestedUser ) );
127  } else {
128  $conds[] = 'user_name >= ' . $dbr->addQuotes( $this->requestedUser );
129  }
130  }
131 
132  if ( $this->editsOnly ) {
133  $conds[] = 'user_editcount > 0';
134  }
135 
136  $options['GROUP BY'] = $this->creationSort ? 'user_id' : 'user_name';
137 
138  $query = [
139  'tables' => [ 'user', 'user_groups', 'ipblocks' ],
140  'fields' => [
141  'user_name' => $this->creationSort ? 'MAX(user_name)' : 'user_name',
142  'user_id' => $this->creationSort ? 'user_id' : 'MAX(user_id)',
143  'edits' => 'MAX(user_editcount)',
144  'creation' => 'MIN(user_registration)',
145  'ipb_deleted' => 'MAX(ipb_deleted)' // block/hide status
146  ],
147  'options' => $options,
148  'join_conds' => [
149  'user_groups' => [ 'LEFT JOIN', 'user_id=ug_user' ],
150  'ipblocks' => [
151  'LEFT JOIN', [
152  'user_id=ipb_user',
153  'ipb_auto' => 0
154  ]
155  ],
156  ],
157  'conds' => $conds
158  ];
159 
160  Hooks::run( 'SpecialListusersQueryInfo', [ $this, &$query ] );
161 
162  return $query;
163  }
164 
169  function formatRow( $row ) {
170  if ( $row->user_id == 0 ) { # T18487
171  return '';
172  }
173 
174  $userName = $row->user_name;
175 
176  $ulinks = Linker::userLink( $row->user_id, $userName );
178  $row->user_id,
179  $userName,
180  (int)$row->edits
181  );
182 
183  $lang = $this->getLanguage();
184 
185  $groups = '';
186  $ugms = self::getGroupMemberships( intval( $row->user_id ), $this->userGroupCache );
187 
188  if ( !$this->including && count( $ugms ) > 0 ) {
189  $list = [];
190  foreach ( $ugms as $ugm ) {
191  $list[] = $this->buildGroupLink( $ugm, $userName );
192  }
193  $groups = $lang->commaList( $list );
194  }
195 
196  $item = $lang->specialList( $ulinks, $groups );
197 
198  if ( $row->ipb_deleted ) {
199  $item = "<span class=\"deleted\">$item</span>";
200  }
201 
202  $edits = '';
203  if ( !$this->including && $this->getConfig()->get( 'Edititis' ) ) {
204  $count = $this->msg( 'usereditcount' )->numParams( $row->edits )->escaped();
205  $edits = $this->msg( 'word-separator' )->escaped() . $this->msg( 'brackets', $count )->escaped();
206  }
207 
208  $created = '';
209  # Some rows may be null
210  if ( !$this->including && $row->creation ) {
211  $user = $this->getUser();
212  $d = $lang->userDate( $row->creation, $user );
213  $t = $lang->userTime( $row->creation, $user );
214  $created = $this->msg( 'usercreated', $d, $t, $row->user_name )->escaped();
215  $created = ' ' . $this->msg( 'parentheses' )->rawParams( $created )->escaped();
216  }
217  $blocked = !is_null( $row->ipb_deleted ) ?
218  ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() :
219  '';
220 
221  Hooks::run( 'SpecialListusersFormatRow', [ &$item, $row ] );
222 
223  return Html::rawElement( 'li', [], "{$item}{$edits}{$created}{$blocked}" );
224  }
225 
226  function doBatchLookups() {
227  $batch = new LinkBatch();
228  $userIds = [];
229  # Give some pointers to make user links
230  foreach ( $this->mResult as $row ) {
231  $batch->add( NS_USER, $row->user_name );
232  $batch->add( NS_USER_TALK, $row->user_name );
233  $userIds[] = $row->user_id;
234  }
235 
236  // Lookup groups for all the users
237  $dbr = wfGetDB( DB_REPLICA );
238  $groupRes = $dbr->select(
239  'user_groups',
241  [ 'ug_user' => $userIds ],
242  __METHOD__
243  );
244  $cache = [];
245  $groups = [];
246  foreach ( $groupRes as $row ) {
247  $ugm = UserGroupMembership::newFromRow( $row );
248  if ( !$ugm->isExpired() ) {
249  $cache[$row->ug_user][$row->ug_group] = $ugm;
250  $groups[$row->ug_group] = true;
251  }
252  }
253 
254  // Give extensions a chance to add things like global user group data
255  // into the cache array to ensure proper output later on
256  Hooks::run( 'UsersPagerDoBatchLookups', [ $dbr, $userIds, &$cache, &$groups ] );
257 
258  $this->userGroupCache = $cache;
259 
260  // Add page of groups to link batch
261  foreach ( $groups as $group => $unused ) {
262  $groupPage = UserGroupMembership::getGroupPage( $group );
263  if ( $groupPage ) {
264  $batch->addObj( $groupPage );
265  }
266  }
267 
268  $batch->execute();
269  $this->mResult->rewind();
270  }
271 
275  function getPageHeader() {
276  list( $self ) = explode( '/', $this->getTitle()->getPrefixedDBkey() );
277 
278  $groupOptions = [ $this->msg( 'group-all' )->text() => '' ];
279  foreach ( $this->getAllGroups() as $group => $groupText ) {
280  $groupOptions[ $groupText ] = $group;
281  }
282 
283  $formDescriptor = [
284  'user' => [
285  'class' => HTMLUserTextField::class,
286  'label' => $this->msg( 'listusersfrom' )->text(),
287  'name' => 'username',
288  'default' => $this->requestedUser,
289  ],
290  'dropdown' => [
291  'label' => $this->msg( 'group' )->text(),
292  'name' => 'group',
293  'default' => $this->requestedGroup,
294  'class' => HTMLSelectField::class,
295  'options' => $groupOptions,
296  ],
297  'editsOnly' => [
298  'type' => 'check',
299  'label' => $this->msg( 'listusers-editsonly' )->text(),
300  'name' => 'editsOnly',
301  'id' => 'editsOnly',
302  'default' => $this->editsOnly
303  ],
304  'temporaryGroupsOnly' => [
305  'type' => 'check',
306  'label' => $this->msg( 'listusers-temporarygroupsonly' )->text(),
307  'name' => 'temporaryGroupsOnly',
308  'id' => 'temporaryGroupsOnly',
309  'default' => $this->temporaryGroupsOnly
310  ],
311  'creationSort' => [
312  'type' => 'check',
313  'label' => $this->msg( 'listusers-creationsort' )->text(),
314  'name' => 'creationSort',
315  'id' => 'creationSort',
316  'default' => $this->creationSort
317  ],
318  'desc' => [
319  'type' => 'check',
320  'label' => $this->msg( 'listusers-desc' )->text(),
321  'name' => 'desc',
322  'id' => 'desc',
323  'default' => $this->mDefaultDirection
324  ],
325  'limithiddenfield' => [
326  'class' => HTMLHiddenField::class,
327  'name' => 'limit',
328  'default' => $this->mLimit
329  ]
330  ];
331 
332  $beforeSubmitButtonHookOut = '';
333  Hooks::run( 'SpecialListusersHeaderForm', [ $this, &$beforeSubmitButtonHookOut ] );
334 
335  if ( $beforeSubmitButtonHookOut !== '' ) {
336  $formDescriptor[ 'beforeSubmitButtonHookOut' ] = [
337  'class' => HTMLInfoField::class,
338  'raw' => true,
339  'default' => $beforeSubmitButtonHookOut
340  ];
341  }
342 
343  $formDescriptor[ 'submit' ] = [
344  'class' => HTMLSubmitField::class,
345  'buttonlabel-message' => 'listusers-submit',
346  ];
347 
348  $beforeClosingFieldsetHookOut = '';
349  Hooks::run( 'SpecialListusersHeader', [ $this, &$beforeClosingFieldsetHookOut ] );
350 
351  if ( $beforeClosingFieldsetHookOut !== '' ) {
352  $formDescriptor[ 'beforeClosingFieldsetHookOut' ] = [
353  'class' => HTMLInfoField::class,
354  'raw' => true,
355  'default' => $beforeClosingFieldsetHookOut
356  ];
357  }
358 
359  $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
360  $htmlForm
361  ->setMethod( 'get' )
362  ->setAction( Title::newFromText( $self )->getLocalURL() )
363  ->setId( 'mw-listusers-form' )
364  ->setFormIdentifier( 'mw-listusers-form' )
365  ->suppressDefaultSubmit()
366  ->setWrapperLegendMsg( 'listusers' );
367  return $htmlForm->prepareForm()->getHTML( true );
368  }
369 
374  function getAllGroups() {
375  $result = [];
376  foreach ( User::getAllGroups() as $group ) {
377  $result[$group] = UserGroupMembership::getGroupName( $group );
378  }
379  asort( $result );
380 
381  return $result;
382  }
383 
388  function getDefaultQuery() {
389  $query = parent::getDefaultQuery();
390  if ( $this->requestedGroup != '' ) {
391  $query['group'] = $this->requestedGroup;
392  }
393  if ( $this->requestedUser != '' ) {
394  $query['username'] = $this->requestedUser;
395  }
396  Hooks::run( 'SpecialListusersDefaultQuery', [ $this, &$query ] );
397 
398  return $query;
399  }
400 
409  protected static function getGroupMemberships( $uid, $cache = null ) {
410  if ( $cache === null ) {
411  $user = User::newFromId( $uid );
412  return $user->getGroupMemberships();
413  } else {
414  return $cache[$uid] ?? [];
415  }
416  }
417 
425  protected function buildGroupLink( $group, $username ) {
426  return UserGroupMembership::getLink( $group, $this->getContext(), 'html', $username );
427  }
428 }
ContextSource\$context
IContextSource $context
Definition: ContextSource.php:33
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:63
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:244
User\newFromId
static newFromId( $id)
Static factory method for creation from a given user ID.
Definition: User.php:615
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:280
ContextSource\getContext
getContext()
Get the base IContextSource object.
Definition: ContextSource.php:40
Linker\userToolLinksRedContribs
static userToolLinksRedContribs( $userId, $userText, $edits=null)
Alias for userToolLinks( $userId, $userText, true );.
Definition: Linker.php:976
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:34
Linker\userLink
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
Definition: Linker.php:876
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:33
captcha-old.count
count
Definition: captcha-old.py:249
UsersPager\getIndexField
getIndexField()
Definition: UsersPager.php:96
ContextSource\msg
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:168
UsersPager\buildGroupLink
buildGroupLink( $group, $username)
Format a link to a group description page.
Definition: UsersPager.php:425
UserGroupMembership\getGroupName
static getGroupName( $group)
Gets the localized friendly name for a group, if it exists.
Definition: UserGroupMembership.php:431
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED since 1.16! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:2034
IndexPager\$mDefaultDirection
$mDefaultDirection
$mDefaultDirection gives the direction to use when sorting results: DIR_ASCENDING or DIR_DESCENDING.
Definition: IndexPager.php:111
including
within a display generated by the Derivative if and wherever such third party notices normally appear The contents of the NOTICE file are for informational purposes only and do not modify the License You may add Your own attribution notices within Derivative Works that You alongside or as an addendum to the NOTICE text from the provided that such additional attribution notices cannot be construed as modifying the License You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for or distribution of Your or for any such Derivative Works as a provided Your and distribution of the Work otherwise complies with the conditions stated in this License Submission of Contributions Unless You explicitly state any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this without any additional terms or conditions Notwithstanding the nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions Trademarks This License does not grant permission to use the trade service or product names of the except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file Disclaimer of Warranty Unless required by applicable law or agreed to in Licensor provides the WITHOUT WARRANTIES OR CONDITIONS OF ANY either express or including
Definition: APACHE-LICENSE-2.0.txt:147
AlphabeticPager
IndexPager with an alphabetic list and a formatted navigation bar.
Definition: AlphabeticPager.php:28
$formDescriptor
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead & $formDescriptor
Definition: hooks.txt:2115
ContextSource\getRequest
getRequest()
Definition: ContextSource.php:71
UsersPager\__construct
__construct(IContextSource $context=null, $par=null, $including=null)
Definition: UsersPager.php:46
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ContextSource\getTitle
getTitle()
Definition: ContextSource.php:79
UserGroupMembership\getGroupPage
static getGroupPage( $group)
Gets the title of a page describing a particular user group.
Definition: UserGroupMembership.php:456
IndexPager\DIR_ASCENDING
const DIR_ASCENDING
Constants for the $mDefaultDirection field.
Definition: IndexPager.php:75
UsersPager\getPageHeader
getPageHeader()
Definition: UsersPager.php:275
php
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
Definition: injection.txt:35
$dbr
$dbr
Definition: testCompression.php:50
ContextSource\getLanguage
getLanguage()
Definition: ContextSource.php:128
$query
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1627
UsersPager\getDefaultQuery
getDefaultQuery()
Preserve group and username offset parameters when paging.
Definition: UsersPager.php:388
UserGroupMembership\getLink
static getLink( $ugm, IContextSource $context, $format, $userName=null)
Gets a link for a user group, possibly including the expiry date if relevant.
Definition: UserGroupMembership.php:373
UsersPager\doBatchLookups
doBatchLookups()
Called from getBody(), before getStartBody() is called and after doQuery() was called.
Definition: UsersPager.php:226
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2693
HTMLForm\factory
static factory( $displayFormat)
Construct a HTMLForm object for given display type.
Definition: HTMLForm.php:286
IndexPager\$mLimit
$mLimit
Definition: IndexPager.php:81
UserGroupMembership\newFromRow
static newFromRow( $row)
Creates a new UserGroupMembership object from a database row.
Definition: UserGroupMembership.php:93
UsersPager
This class is used to get a list of user.
Definition: UsersPager.php:33
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
array
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
ContextSource\setContext
setContext(IContextSource $context)
Definition: ContextSource.php:55
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
UsersPager\getAllGroups
getAllGroups()
Get a list of all explicit groups.
Definition: UsersPager.php:374
UserGroupMembership\selectFields
static selectFields()
Returns the list of user_groups fields that should be selected to create a new user group membership.
Definition: UserGroupMembership.php:104
$request
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
Definition: hooks.txt:2675
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:573
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:67
UsersPager\formatRow
formatRow( $row)
Definition: UsersPager.php:169
User\getAllGroups
static getAllGroups()
Return the set of defined explicit groups.
Definition: User.php:5108
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:53
UsersPager\getGroupMemberships
static getGroupMemberships( $uid, $cache=null)
Get an associative array containing groups the specified user belongs to, and the relevant UserGroupM...
Definition: UsersPager.php:409
IndexPager\DIR_DESCENDING
const DIR_DESCENDING
Definition: IndexPager.php:76
UsersPager\$userGroupCache
array[] $userGroupCache
A array with user ids as key and a array of groups as value.
Definition: UsersPager.php:38
$self
$self
Definition: doMaintenance.php:55
UsersPager\getQueryInfo
getQueryInfo()
Definition: UsersPager.php:103
$cache
$cache
Definition: mcc.php:33
$options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:2036
User\idFromName
static idFromName( $name, $flags=self::READ_NORMAL)
Get database id given a user name.
Definition: User.php:911
as
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
Definition: distributors.txt:9
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:210
NS_USER
const NS_USER
Definition: Defines.php:66
$batch
$batch
Definition: linkcache.txt:23
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
$t
$t
Definition: testCompression.php:69
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
$username
this hook is for auditing only or null if authentication failed before getting that far $username
Definition: hooks.txt:813