38 return $this->
msg(
'creditspage' )->escaped();
47 if ( $this->
page->getID() == 0 ) {
48 $s = $this->
msg(
'nocredits' )->parse();
53 return Html::rawElement(
'div', [
'id' =>
'mw-credits' ],
$s );
68 if ( $cnt > 1 || $cnt < 0 ) {
84 $timestamp =
$page->getTimestamp();
87 $d =
$lang->date(
$page->getTimestamp(),
true );
94 return $this->
msg(
'lastmodifiedatby', $d,
$t )->rawParams(
105 $hiddenPrefs = $this->context->getConfig()->get(
'HiddenPrefs' );
106 return !in_array(
'realname', $hiddenPrefs );
118 $others_link =
false;
120 # Hmm... too many to fit!
124 return $this->
msg(
'othercontribs' )->rawParams(
133 # Sift for real versus user names
137 if (
$user->isLoggedIn() ) {
140 $real_names[] =
$link;
142 $user_names[] =
$link;
145 $anon_ips[] = $this->
link( $user );
155 if ( count( $real_names ) ) {
156 $real =
$lang->listToText( $real_names );
161 # "ThisSite user(s) A, B and C"
162 if ( count( $user_names ) ) {
163 $user = $this->
msg(
'siteusers' )->rawParams(
$lang->listToText( $user_names ) )->params(
164 count( $user_names ) )->escaped();
169 if ( count( $anon_ips ) ) {
170 $anon = $this->
msg(
'anonusers' )->rawParams(
$lang->listToText( $anon_ips ) )->params(
171 count( $anon_ips ) )->escaped();
176 # This is the big list, all mooshed together. We sift for blank strings
178 foreach ( [ $real,
$user, $anon, $others_link ]
as $s ) {
179 if (
$s !==
false ) {
180 array_push( $fulllist,
$s );
184 $count = count( $fulllist );
186 # "Based on work by ..."
188 ? $this->
msg(
'othercontribs' )->rawParams(
189 $lang->listToText( $fulllist ) )->params( $count )->escaped()
200 $real =
$user->getRealName();
201 if ( $real ===
'' ) {
202 $real =
$user->getName();
205 $real =
$user->getName();
209 ? SpecialPage::getTitleFor(
'Contributions',
$user->getName() )
210 :
$user->getUserPage();
212 return MediaWikiServices::getInstance()
213 ->getLinkRenderer()->makeLink(
$page, $real );
223 if (
$user->isAnon() ) {
224 return $this->
msg(
'anonuser' )->rawParams(
$link )->parse();
228 return $this->
msg(
'siteuser' )->rawParams(
$link )->params( $user->
getName() )->escaped();
237 return MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
239 $this->
msg(
'others' )->
text(),
241 [
'action' =>
'credits' ]
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
$page
Page on which we're performing the action.
getTitle()
Shortcut to get the Title object from the page.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getLanguage()
Shortcut to get the user Language being used for this instance.
getCredits( $cnt, $showIfMax=true)
Get a list of contributors.
getName()
Return the name of the action this object responds to.
getContributors( $cnt, $showIfMax)
Get a list of contributors of $article.
getAuthor(Page $page)
Get the last author with the last modification time.
canShowRealUserName()
Whether we can display the user's real name (not a hidden pref)
othersLink()
Get a link to action=credits of $article page.
getDescription()
Returns the description that goes below the <h1> tag.
link(User $user)
Get a link to $user's user page.
onView()
This is largely cadged from PageHistory::history.
userLink(User $user)
Get a link to $user's user page.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getName()
Get the user name, or the IP of an anonymous user.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getRealName()
Get the user's real name.
isAnon()
Get whether the user is anonymous.
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
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template to be included in the link
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
if(!isset( $args[0])) $lang