Go to the documentation of this file.
35 static $instance =
null;
36 if ( $instance ===
null ) {
37 $instance =
new self();
53 public function getProp( $userId, $prop ) {
54 if ( !isset( $this->
cache[$userId][$prop] ) ) {
55 wfDebug( __METHOD__ .
": querying DB for prop '$prop' for user ID '$userId'.\n" );
59 return isset( $this->
cache[$userId][$prop] )
60 ? $this->
cache[$userId][$prop]
73 return $userId > 0 ? $this->
getProp( $userId,
'name' ) : $ip;
85 $usersToCheck =
array();
86 $usersToQuery =
array();
88 $userIds = array_unique( $userIds );
90 foreach ( $userIds
as $userId ) {
91 $userId = (int)$userId;
95 if ( isset( $this->
cache[$userId][
'name'] ) ) {
96 $usersToCheck[$userId] = $this->
cache[$userId][
'name'];
98 $usersToQuery[] = $userId;
103 if ( count( $usersToQuery ) ) {
105 $table =
array(
'user' );
106 $conds =
array(
'user_id' => $usersToQuery );
107 $fields =
array(
'user_name',
'user_real_name',
'user_registration',
'user_id' );
110 if ( strval( $caller ) !==
'' ) {
115 foreach (
$res as $row ) {
116 $userId = (int)$row->user_id;
117 $this->cache[$userId][
'name'] = $row->user_name;
118 $this->cache[$userId][
'real_name'] = $row->user_real_name;
119 $this->cache[$userId][
'registration'] = $row->user_registration;
120 $usersToCheck[$userId] = $row->user_name;
125 foreach ( $usersToCheck
as $userId =>
$name ) {
127 $lb->add(
NS_USER, str_replace(
' ',
'_', $row->user_name ) );
128 $this->typesCached[$userId][
'userpage'] = 1;
132 $this->typesCached[$userId][
'usertalk'] = 1;
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Class representing a list of titles The execute() method checks them all for existence and adds them ...
queryNeeded( $uid, $type, array $options)
Check if a cache type is in $options and was not loaded for this user.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
wfProfileIn( $functionname)
Begin profiling of a function.
you have access to all of the normal MediaWiki so you can get a DB use the cache
if( $wgAPIRequestLog) $lb
getProp( $userId, $prop)
Get a property of a user based on their user ID.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
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
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Allows to change the fields on the form that will be generated $name
getUserName( $userId, $ip)
Get the name of a user or return $ip if the user ID is 0.
doQuery(array $userIds, $options=array(), $caller='')
Preloads user names for given list of users.
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