Go to the documentation of this file.
36 'helptext' => $helptext,
41 global $wgCookieExpiration;
42 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
44 <div
class=
"mw-ui-container">
46 <div
id=
"languagelinks">
47 <p><?
php $this->
html(
'languages' ); ?></p>
50 if ( !
wfMessage(
'signupstart' )->isDisabled() ) { ?>
51 <div
id=
"signupstart"><?
php $this->
msgWiki(
'signupstart' ); ?></div>
53 <div
id=
"userloginForm">
54 <h2
class=
"createaccount-join">
55 <?
php $this->
msg( $this->
data[
'loggedin'] ?
'createacct-another-join' :
'createacct-join' ); ?>
57 <
form name=
"userlogin2" id=
"userlogin2" class=
"mw-ui-vform" method=
"post" action=
"<?php $this->text( 'action' ); ?>">
58 <
section class=
"mw-form-header">
59 <?
php $this->
html(
'header' ); ?>
61 <!-- This element
is used by the mediawiki.special.userlogin.signup.js module. -->
63 id=
"mw-createacct-status-area"
64 <?
php if ( $this->
data[
'message'] ) { ?>
65 class=
"<?php echo $this->data['messagetype']; ?>box"
67 style=
"display: none;"
70 <?
php if ( $this->
data[
'message'] ) { ?>
71 <?
php if ( $this->
data[
'messagetype'] ==
'error' ) { ?>
72 <strong><?
php $this->
msg(
'createacct-error' ); ?></strong>
75 <?
php $this->
html(
'message' ); ?>
81 <?
php $this->
msg(
'userlogin-yourname' ); ?>
83 <span
class=
"mw-ui-flush-right"><?
php echo $this->
getMsg(
'createacct-helpusername' )->parse(); ?></span>
87 'class' =>
'mw-input loginText',
92 'placeholder' => $this->
getMsg( $this->
data[
'loggedin'] ?
93 'createacct-another-username-ph' :
'userlogin-yourname-ph' )->
text(),
99 <?
php if ( $this->
data[
'createemail'] ) { ?>
100 <label
class=
"mw-ui-checkbox-label">
101 <input
name=
"wpCreateaccountMail" type=
"checkbox" value=
"1" id=
"wpCreateaccountMail" tabindex=
"2"
102 <?
php if ( $this->
data[
'createemailset'] ) {
103 echo
'checked="checked"';
106 <?
php $this->
msg(
'createaccountmail' ); ?>
111 <div
class=
"mw-row-password">
112 <label
for=
'wpPassword2'><?
php $this->
msg(
'userlogin-yourpassword' ); ?></label>
115 'class' =>
'mw-input loginPassword',
116 'id' =>
'wpPassword2',
120 'placeholder' => $this->
getMsg(
'createacct-yourpassword-ph' )->
text()
126 if ( $this->
data[
'usedomain'] ) {
127 $select =
new XmlSelect(
'wpDomain',
false, $this->
data[
'domain'] );
128 $select->setAttribute(
'tabindex', 4 );
129 foreach ( $this->
data[
'domainnames']
as $dom ) {
130 $select->addOption( $dom );
133 <div
id=
"mw-user-domain-section">
134 <label
for=
"wpDomain"><?
php $this->
msg(
'yourdomainname' ); ?></label>
135 <div
class=
"mw-input">
136 <?
php echo $select->getHTML(); ?>
141 <div
class=
"mw-row-password">
142 <label
for=
'wpRetype'><?
php $this->
msg(
'createacct-yourpasswordagain' ); ?></label>
145 'class' =>
'mw-input loginPassword',
150 'placeholder' => $this->
getMsg(
'createacct-yourpasswordagain-ph' )->
text()
156 <?
php if ( $this->
data[
'useemail'] ) { ?>
157 <label
for=
'wpEmail'>
159 $this->
msg( $this->
data[
'emailrequired'] ?
160 'createacct-emailrequired' :
161 'createacct-emailoptional'
167 'class' =>
'mw-input loginText',
171 'required' => $this->
data[
'emailrequired'],
172 'placeholder' => $this->
getMsg( $this->
data[
'loggedin'] ?
173 'createacct-another-email-ph' :
'createacct-email-ph' )->
text()
179 <?
php if ( $this->
data[
'userealname'] ) { ?>
181 <label
for=
'wpRealName'><?
php $this->
msg(
'createacct-realname' ); ?></label>
182 <input
type=
'text' class=
'mw-input loginText' name=
"wpRealName" id=
"wpRealName"
184 value=
"<?php $this->text( 'realname' ); ?>" size=
'20' />
185 <div
class=
"prefsectiontip">
186 <?
php $this->
msgWiki( $this->
data[
'loggedin'] ?
'createacct-another-realname-tip' :
'prefs-help-realname' ); ?>
191 <?
php if ( $this->
data[
'usereason'] ) { ?>
193 <label
for=
'wpReason'><?
php $this->
msg(
'createacct-reason' ); ?></label>
195 'class' =>
'mw-input loginText',
199 'placeholder' => $this->
getMsg(
'createacct-reason-ph' )->
text()
206 if ( isset( $this->
data[
'extraInput'] ) && is_array( $this->
data[
'extraInput'] ) ) {
207 foreach ( $this->
data[
'extraInput']
as $inputItem ) { ?>
211 if ( $inputItem[
'type'] ==
'checkbox' ) {
213 <label
class=
"mw-ui-checkbox-label">
215 name=
"<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
216 id=
"<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
217 type=
"checkbox" value=
"1"
218 tabindex=
"<?php echo $tabIndex++; ?>"
219 <?
php if ( !empty( $inputItem[
'value'] ) ) {
220 echo
'checked="checked"';
230 <?
php if ( !empty( $inputItem[
'msg'] ) ) { ?>
231 <label
for=
"<?php echo htmlspecialchars( $inputItem['name'] ); ?>">
236 type=
"<?php echo htmlspecialchars( $inputItem['type'] ); ?>"
238 name=
"<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
239 tabindex=
"<?php echo $tabIndex++; ?>"
240 value=
"<?php echo htmlspecialchars( $inputItem['value'] ); ?>"
241 id=
"<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
244 <?
php if ( $inputItem[
'helptext'] !==
false ) { ?>
245 <div
class=
"prefsectiontip">
246 <?
php $this->
msgWiki( $inputItem[
'helptext'] ); ?>
258 <div
class=
"mw-submit">
262 $this->
getMsg( $this->
data[
'loggedin'] ?
'createacct-another-submit' :
'createacct-submit' ),
265 'class' =>
"mw-ui-button mw-ui-big mw-ui-block mw-ui-constructive",
266 'id' =>
'wpCreateaccount',
272 <?
php if ( $this->
haveData(
'uselang' ) ) { ?><input
type=
"hidden" name=
"uselang" value=
"<?php $this->text( 'uselang' ); ?>" /><?
php } ?>
273 <?
php if ( $this->
haveData(
'token' ) ) { ?><input
type=
"hidden" name=
"wpCreateaccountToken" value=
"<?php $this->text( 'token' ); ?>" /><?
php } ?>
275 <?
php if ( !
wfMessage(
'signupend' )->isDisabled() ) { ?>
276 <div
id=
"signupend"><?
php $this->
html(
'signupend' ); ?></div>
279 <div
class=
"mw-createacct-benefits-container">
280 <h2><?
php $this->
msg(
'createacct-benefit-heading' ); ?></h2>
281 <div
class=
"mw-createacct-benefits-list">
283 for ( $benefitIdx = 1; $benefitIdx <= $this->
data[
'benefitCount']; $benefitIdx++ ) {
285 $headUnescaped = $this->
getMsg(
"createacct-benefit-head$benefitIdx" )->text();
287 <div
class=
"mw-number-text <?php $this->msg( "createacct-benefit-icon$benefitIdx
" ); ?>">
288 <h3><?
php $this->
msg(
"createacct-benefit-head$benefitIdx" ); ?></h3>
289 <p><?
php echo $this->
getMsg(
"createacct-benefit-body$benefitIdx" )->params( $headUnescaped )->escaped(); ?></p>
static passwordChangeInputAttribs()
Provide an array of HTML5 attributes to put on an input element intended for the user to enter a new ...
msgWiki( $str)
An ugly, ugly hack.
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
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
We use the convention $dbr for read and $dbw for write to help you keep track of whether the database object is a the world will explode Or to be a subsequent write query which succeeded on the master may fail when replicated to the slave due to a unique key collision Replication on the slave will stop and it may take hours to repair the database and get it back online Setting read_only in my cnf on the slave will avoid this but given the dire we prefer to have as many checks as possible We provide a but the wrapper functions like please read the documentation for except in special pages derived from QueryPage It s a common pitfall for new developers to submit code containing SQL queries which examine huge numbers of rows Remember that COUNT * is(N), counting rows in atable is like counting beans in a bucket.------------------------------------------------------------------------ Replication------------------------------------------------------------------------The largest installation of MediaWiki, Wikimedia, uses a large set ofslave MySQL servers replicating writes made to a master MySQL server. Itis important to understand the issues associated with this setup if youwant to write code destined for Wikipedia.It 's often the case that the best algorithm to use for a given taskdepends on whether or not replication is in use. Due to our unabashedWikipedia-centrism, we often just use the replication-friendly version, but if you like, you can use wfGetLB() ->getServerCount() > 1 tocheck to see if replication is in use.===Lag===Lag primarily occurs when large write queries are sent to the master.Writes on the master are executed in parallel, but they are executed inserial when they are replicated to the slaves. The master writes thequery to the binlog when the transaction is committed. The slaves pollthe binlog and start executing the query as soon as it appears. They canservice reads while they are performing a write query, but will not readanything more from the binlog and thus will perform no more writes. Thismeans that if the write query runs for a long time, the slaves will lagbehind the master for the time it takes for the write query to complete.Lag can be exacerbated by high read load. MediaWiki 's load balancer willstop sending reads to a slave when it is lagged by more than 30 seconds.If the load ratios are set incorrectly, or if there is too much loadgenerally, this may lead to a slave permanently hovering around 30seconds lag.If all slaves are lagged by more than 30 seconds, MediaWiki will stopwriting to the database. All edits and other write operations will berefused, with an error returned to the user. This gives the slaves achance to catch up. Before we had this mechanism, the slaves wouldregularly lag by several minutes, making review of recent editsdifficult.In addition to this, MediaWiki attempts to ensure that the user seesevents occurring on the wiki in chronological order. A few seconds of lagcan be tolerated, as long as the user sees a consistent picture fromsubsequent requests. This is done by saving the master binlog positionin the session, and then at the start of each request, waiting for theslave to catch up to that position before doing any reads from it. Ifthis wait times out, reads are allowed anyway, but the request isconsidered to be in "lagged slave mode". Lagged slave mode can bechecked by calling wfGetLB() ->getLaggedSlaveMode(). The onlypractical consequence at present is a warning displayed in the pagefooter.===Lag avoidance===To avoid excessive lag, queries which write large numbers of rows shouldbe split up, generally to write one row at a time. Multi-row INSERT ...SELECT queries are the worst offenders should be avoided altogether.Instead do the select first and then the insert.===Working with lag===Despite our best efforts, it 's not practical to guarantee a low-lagenvironment. Lag will usually be less than one second, but mayoccasionally be up to 30 seconds. For scalability, it 's very importantto keep load on the master low, so simply sending all your queries tothe master is not the answer. So when you have a genuine need forup-to-date data, the following approach is advised:1) Do a quick query to the master for a sequence number or timestamp 2) Run the full query on the slave and check if it matches the data you gotfrom the master 3) If it doesn 't, run the full query on the masterTo avoid swamping the master every time the slaves lag, use of thisapproach should be kept to a minimum. In most cases you should just readfrom the slave and let the user deal with the delay.------------------------------------------------------------------------ Lock contention------------------------------------------------------------------------Due to the high write rate on Wikipedia(and some other wikis), MediaWiki developers need to be very careful to structure their writesto avoid long-lasting locks. By default, MediaWiki opens a transactionat the first query, and commits it before the output is sent. Locks willbe held from the time when the query is done until the commit. So youcan reduce lock time by doing as much processing as possible before youdo your write queries.Often this approach is not good enough, and it becomes necessary toenclose small groups of queries in their own transaction. Use thefollowing syntax:$dbw=wfGetDB(DB_MASTER
execute()
Main function, used by classes that subclass QuickTemplate to show the actual HTML output.
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 noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
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
null means default in associative array form
static input( $name, $value='', $type='text', $attribs=array())
Convenience function to produce an "<input>" element.
addInputItem( $name, $value, $type, $msg, $helptext=false)
Extensions (AntiSpoof and TitleBlacklist) call this in response to UserCreateForm hook to add checkbo...
Allows to change the fields on the form that will be generated $name
getMsg( $name)
Get a Message object with its context set.
if( $this->data['usereason']) $tabIndex
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
you don t have to do a grep find to see where the $wgReverseTitle variable is used
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
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
New base template for a skin's template extended from QuickTemplate this class features helper method...