Go to the documentation of this file.
41 if ( $that ===
null ) {
56 if ( $this->
default ===
null ) {
72 if ( $username instanceof
User ) {
73 $username = $username->getName();
77 if ( !isset( $this->
cache[$username] ) ) {
78 if ( $this->misses >= $this->missLimit &&
$wgUser->getName() !== $username ) {
79 if ( $this->misses === $this->missLimit ) {
81 wfDebug( __METHOD__ .
": too many misses, returning default onwards\n" );
87 $this->
doQuery( $username, $caller );
105 foreach ( $data
as $ns => $pagenames ) {
109 foreach ( array_keys( $pagenames )
as $username ) {
110 $users[$username] =
true;
114 $this->
doQuery( array_keys( $users ), $caller );
134 $users[] = $titleObj->getText();
137 $this->
doQuery( $users, $caller );
145 public function doQuery( $users, $caller =
'' ) {
148 $usersToCheck =
array();
157 $usersToCheck[] =
$name;
162 if ( count( $usersToCheck ) === 0 ) {
167 $table =
array(
'user',
'user_properties' );
168 $fields =
array(
'user_name',
'up_value' );
169 $conds =
array(
'user_name' => $usersToCheck );
170 $joins =
array(
'user_properties' =>
171 array(
'LEFT JOIN',
array(
'user_id = up_user',
'up_property' =>
'gender' ) ) );
174 if ( strval( $caller ) !==
'' ) {
179 foreach (
$res as $row ) {
180 $this->
cache[$row->user_name] = $row->up_value ? $row->up_value :
$default;
186 $indexSlash = strpos( $username,
'/' );
187 if ( $indexSlash !==
false ) {
188 $username = substr( $username, 0, $indexSlash );
192 return strtr( $username,
'_',
' ' );
static getDefaultOption( $opt)
Get a given default option value.
doLinkBatch( $data, $caller='')
Wrapper for doQuery that processes raw LinkBatch data.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
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
static hasGenderDistinction( $index)
Does the namespace (potentially) have different aliases for different genders.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Caches user genders when needed to use correct namespace aliases.
static isValidUserName( $name)
Is the input a valid username?
you have access to all of the normal MediaWiki so you can get a DB use the cache
getGenderOf( $username, $caller='')
Returns the gender for given username.
doTitlesArray( $titles, $caller='')
Wrapper for doQuery that processes a title or string array.
getDefault()
Returns the default gender option in this wiki.
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
static normalizeUsername( $username)
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
presenting them properly to the user as errors is done by the caller $title
Allows to change the fields on the form that will be generated $name
doQuery( $users, $caller='')
Preloads genders 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
The User object encapsulates all of the user-specific settings (user_id, name, rights,...