53 $this->
id = intval(
$id );
54 $this->newOptions = [];
129 if (
$db && $userdb ) {
130 $row = $userdb->selectRow(
'user',
131 [
'user_id',
'user_name' ],
135 if ( $row !==
false ) {
137 $db,
$wikiId, $row->user_name, intval( $row->user_id ) );
152 if ( $ignoreInvalidDB || self::validDatabase(
$wikiId ) ) {
153 if ( WikiMap::isCurrentWikiId(
$wikiId ) ) {
174 return $this->
getId() == 0;
200 return array_keys( self::getGroupMemberships() );
210 return UserGroupMembership::getMembershipsForUser( $this->
id, $this->db );
226 return $ugm->insert(
true, $this->db );
236 $ugm = UserGroupMembership::getMembership( $this->
id, $group, $this->db );
240 return $ugm->delete( $this->db );
249 $this->newOptions[$option] =
$value;
254 foreach ( $this->newOptions
as $option =>
$value ) {
257 'up_property' => $option,
261 $this->db->replace(
'user_properties',
262 [ [
'up_user',
'up_property' ] ],
274 [
'user_touched' => $this->db->timestamp() ],
275 [
'user_id' => $this->id ],
279 $domainId = $this->db->getDomainID();
281 $this->db->onTransactionPreCommitOrIdle(
282 function ()
use ( $domainId, $userId ) {
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgSharedDB
Shared database for multiple wikis.
string[] $wgLocalDatabases
Other wikis on this site, can be administered from a single developer account.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Represents a "user group membership" – a specific instance of a user belonging to a group.
Cut-down copy of User interface for local-interwiki-database user rights manipulation.
getName()
Same as User::getName()
static newFromName( $wikiId, $name, $ignoreInvalidDB=false)
Factory function; get a remote user entry by name.
static getDB( $wikiId, $ignoreInvalidDB=false)
Open a database connection to work on for the requested user.
static newFromLookup( $wikiId, $field, $value, $ignoreInvalidDB=false)
getGroupMemberships()
Replaces User::getGroupMemberships()
static validDatabase( $wikiId)
Confirm the selected database name is a valid local interwiki database name.
removeGroup( $group)
Replaces User::removeGroup()
__construct( $db, $wikiId, $name, $id)
getGroups()
Replaces User::getUserGroups()
setOption( $option, $value)
Replaces User::setOption()
static whoIs( $wikiId, $id, $ignoreInvalidDB=false)
Same as User::whoIs()
static newFromId( $wikiId, $id, $ignoreInvalidDB=false)
Factory function; get a remote user entry by ID number.
invalidateCache()
Replaces User::touchUser()
addGroup( $group, $expiry=null)
Replaces User::addGroup()
getUserPage()
Same as User::getUserPage()
static purge( $wikiId, $userId)
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
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 $rows
and how to run hooks for an and one after Each event has a name
return true to allow those checks to and false if checking is done & $user
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
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))