47 if ( isset( $options[
'help'] ) ) {
52 if ( isset( $options[
'lang'] ) ) {
53 $this->
code = $options[
'lang'];
59 if ( isset( $options[
'level'] ) ) {
60 $this->level = $options[
'level'];
63 $this->doLinks = isset( $options[
'links'] );
64 $this->includeExif = !isset( $options[
'noexif'] );
65 $this->checkAll = isset( $options[
'all'] );
67 if ( isset( $options[
'prefix'] ) ) {
68 $this->linksPrefix = $options[
'prefix'];
71 if ( isset( $options[
'wikilang'] ) ) {
72 $this->wikiCode = $options[
'wikilang'];
75 if ( isset( $options[
'whitelist'] ) ) {
76 $this->checks = explode(
',', $options[
'whitelist'] );
77 } elseif ( isset( $options[
'blacklist'] ) ) {
78 $this->checks = array_diff(
80 explode(
',', $options[
'blacklist'] )
82 } elseif ( isset( $options[
'easy'] ) ) {
88 if ( isset( $options[
'output'] ) ) {
89 $this->
output = $options[
'output'];
92 $this->L =
new Languages( $this->includeExif );
101 'untranslated',
'duplicate',
'obsolete',
'variables',
'empty',
'plural',
102 'whitespace',
'xhtml',
'chars',
'links',
'unbalanced',
'namespace',
103 'projecttalk',
'magic',
'magic-old',
'magic-over',
'magic-case',
104 'special',
'special-old',
114 'namespace',
'projecttalk',
'magic',
'magic-old',
'magic-over',
115 'magic-case',
'special',
'special-old',
125 'duplicate',
'obsolete',
'empty',
'whitespace',
'xhtml',
'chars',
'magic-old',
126 'magic-over',
'magic-case',
'special-old',
136 'untranslated' =>
'getUntranslatedMessages',
137 'duplicate' =>
'getDuplicateMessages',
138 'obsolete' =>
'getObsoleteMessages',
139 'variables' =>
'getMessagesWithMismatchVariables',
140 'plural' =>
'getMessagesWithoutPlural',
141 'empty' =>
'getEmptyMessages',
142 'whitespace' =>
'getMessagesWithWhitespace',
143 'xhtml' =>
'getNonXHTMLMessages',
144 'chars' =>
'getMessagesWithWrongChars',
145 'links' =>
'getMessagesWithDubiousLinks',
146 'unbalanced' =>
'getMessagesWithUnbalanced',
147 'namespace' =>
'getUntranslatedNamespaces',
148 'projecttalk' =>
'getProblematicProjectTalks',
149 'magic' =>
'getUntranslatedMagicWords',
150 'magic-old' =>
'getObsoleteMagicWords',
151 'magic-over' =>
'getOverridingMagicWords',
152 'magic-case' =>
'getCaseMismatchMagicWords',
153 'special' =>
'getUntraslatedSpecialPages',
154 'special-old' =>
'getObsoleteSpecialPages',
166 'namespace' => [
'getNamespaceNames',
'en' ],
167 'projecttalk' => null,
168 'magic' => [
'getMagicWords',
'en' ],
169 'magic-old' => [
'getMagicWords', null ],
170 'magic-over' => [
'getMagicWords', null ],
171 'magic-case' => [
'getMagicWords', null ],
172 'special' => [
'getSpecialPageAliases',
'en' ],
173 'special-old' => [
'getSpecialPageAliases', null ],
183 'untranslated' =>
'$1 message(s) of $2 are not translated to $3, but exist in en:',
184 'duplicate' =>
'$1 message(s) of $2 are translated the same in en and $3:',
186 '$1 message(s) of $2 do not exist in en or are in the ignore list, but exist in $3:',
187 'variables' =>
'$1 message(s) of $2 in $3 don\'t match the variables used in en:',
188 'plural' =>
'$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:',
189 'empty' =>
'$1 message(s) of $2 in $3 are empty or -:',
190 'whitespace' =>
'$1 message(s) of $2 in $3 have trailing whitespace:',
191 'xhtml' =>
'$1 message(s) of $2 in $3 contain illegal XHTML:',
193 '$1 message(s) of $2 in $3 include hidden chars which should not be used in the messages:',
194 'links' =>
'$1 message(s) of $2 in $3 have problematic link(s):',
195 'unbalanced' =>
'$1 message(s) of $2 in $3 have unbalanced {[]}:',
196 'namespace' =>
'$1 namespace name(s) of $2 are not translated to $3, but exist in en:',
198 '$1 namespace name(s) and alias(es) in $3 are project talk namespaces without the parameter:',
199 'magic' =>
'$1 magic word(s) of $2 are not translated to $3, but exist in en:',
200 'magic-old' =>
'$1 magic word(s) of $2 do not exist in en, but exist in $3:',
201 'magic-over' =>
'$1 magic word(s) of $2 in $3 do not contain the original en word(s):',
203 '$1 magic word(s) of $2 in $3 change the case-sensitivity of the original en word:',
204 'special' =>
'$1 special page alias(es) of $2 are not translated to $3, but exist in en:',
205 'special-old' =>
'$1 special page alias(es) of $2 do not exist in en, but exist in $3:',
215 Run
this script to
check a specific language
file,
or all
of them.
220 --all: Check all customized languages.
222 * 0: Skip
the checks (useful
for checking syntax).
234 translate),
if you know what they
are currently
not translated
and want
235 to focus
on other problems (
default off).
238 --easy: Do only
the easy checks, which can be treated
by non-speakers
of
241 Check codes (ideally, all
of them should result 0; all
the checks
are executed
243 * untranslated: Messages which
are required to translate, but
are not
245 * duplicate: Messages which translation equal to fallback.
246 * obsolete: Messages which
are untranslatable
or do not exist, but
are
248 * variables: Messages without variables which should be used,
or with
249 variables which should
not be used.
250 * empty: Empty messages
and messages
that contain only -.
251 * whitespace: Messages which have trailing whitespace.
252 * xhtml: Messages which
are not well-formed XHTML (checks only few common
254 * chars: Messages with hidden characters.
255 * links: Messages which contains
broken links to
pages (does
not find all).
256 * unbalanced: Messages which contains unequal numbers
of opening {[
and
262 * magic-old: Magic words which
do not exist.
263 * magic-over: Magic words
that override the original English word.
264 * magic-
case: Magic words whose translation changes
the case-sensitivity
of
265 the original English word.
277 if ( $this->level > 0 ) {
278 switch ( $this->
output ) {
286 throw new MWException(
"Invalid output type $this->output" );
295 $ignoredCodes = [
'en',
'enRTL' ];
299 if ( $this->checkAll ) {
300 foreach ( $this->L->getLanguages()
as $language ) {
301 if ( !in_array( $language, $ignoredCodes ) ) {
302 $this->results[$language] = $this->
checkLanguage( $language );
306 if ( in_array( $this->
code, $ignoredCodes ) ) {
307 throw new MWException(
"Cannot check code $this->code." );
318 unset( $this->results[
$code][$check][$key] );
330 static $blacklist = null;
332 if ( $blacklist !== null ) {
342 Hooks::run(
'LocalisationChecksBlacklist', [ &$blacklist ] );
358 foreach ( $blacklist
as $item ) {
359 if ( isset( $item[
'check'] ) && $check !== $item[
'check'] ) {
363 if ( isset( $item[
'code'] ) && !in_array(
$code, $item[
'code'] ) ) {
367 if ( isset( $item[
'message'] ) &&
368 ( $message ===
false || !in_array( $message, $item[
'message'] ) )
388 if ( $this->level === 0 ) {
389 $this->L->getMessages(
$code );
395 foreach ( $this->checks
as $check ) {
401 $callback = [
$this->L, $checkFunctions[$check] ];
402 if ( !is_callable( $callback ) ) {
418 if ( $this->doLinks ) {
419 $displayKey = ucfirst( $key );
420 if (
$code == $this->wikiCode ) {
421 return "[[{$this->linksPrefix}MediaWiki:$displayKey|$key]]";
423 return "[[{$this->linksPrefix}MediaWiki:$displayKey/$code|$key]]";
435 $translated = $this->L->getMessages(
$code );
436 $translated = count( $translated[
'translated'] );
440 if ( $check ==
'untranslated' ) {
441 $translatable = $this->L->getGeneralMessages();
442 $total = count( $translatable[
'translatable'] );
445 $totalCount = $totalCount[$check];
446 $callback = [
$this->L, $totalCount[0] ];
447 $callCode = $totalCount[1] ? $totalCount[1] :
$code;
448 $total = count( call_user_func( $callback, $callCode ) );
450 $total = $translated;
452 $search = [
'$1',
'$2',
'$3' ];
455 echo
"\n" . str_replace( $search, $replace, $descriptions[$check] ) .
"\n";
456 if ( $this->level == 1 ) {
457 echo
"[messages are hidden]\n";
463 if ( $this->level == 2 || empty(
$value ) ) {
466 echo
"* $key: '$value'\n";
480 $rows[] =
'! Language !! Code !! Total !! ' .
483 $detailTextForLang =
"==$code==\n";
486 $detailTextForLangChecks = [];
494 $messageDetails = [];
497 $messageDetails[] = $displayKey;
499 $detailTextForLangChecks[] =
"=== $code-$check ===\n* " . implode(
', ', $messageDetails );
500 $numbers[] =
"'''[[#$code-$check|$count]]'''";
506 if ( count( $detailTextForLangChecks ) ) {
507 $detailText .= $detailTextForLang . implode(
"\n", $detailTextForLangChecks ) .
"\n";
511 # Don't list languages without problems
515 $rows[] =
"| $language || $code || $problems || " . implode(
' || ', $numbers );
518 $tableRows = implode(
"\n|-\n", $rows );
526 {|
class=
"sortable wikitable" border=
"2" cellpadding=
"4" cellspacing=
"0" style=
"background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear: both;"
543 if ( !empty( $messages ) ) {
565 if ( isset( $options[
'help'] ) ) {
570 if ( isset( $options[
'lang'] ) ) {
571 $this->
code = $options[
'lang'];
577 if ( isset( $options[
'level'] ) ) {
578 $this->level = $options[
'level'];
581 $this->doLinks = isset( $options[
'links'] );
583 if ( isset( $options[
'wikilang'] ) ) {
584 $this->wikiCode = $options[
'wikilang'];
587 if ( isset( $options[
'whitelist'] ) ) {
588 $this->checks = explode(
',', $options[
'whitelist'] );
589 } elseif ( isset( $options[
'blacklist'] ) ) {
590 $this->checks = array_diff(
592 explode(
',', $options[
'blacklist'] )
594 } elseif ( isset( $options[
'easy'] ) ) {
600 if ( isset( $options[
'output'] ) ) {
601 $this->
output = $options[
'output'];
604 # Some additional checks not enabled by default
605 if ( isset( $options[
'duplicate'] ) ) {
606 $this->checks[] =
'duplicate';
609 $this->extensions = [];
610 $extensions =
new PremadeMediawikiExtensionGroups();
612 if ( $extension ==
'all' ) {
613 foreach ( MessageGroups::singleton()->getGroups()
as $group ) {
614 if ( strpos( $group->getId(),
'ext-' ) === 0 && !$group->isMeta() ) {
618 } elseif ( $extension ==
'wikimedia' ) {
619 $wikimedia = MessageGroups::getGroup(
'ext-0-wikimedia' );
620 foreach ( $wikimedia->wmfextensions()
as $extension ) {
621 $group = MessageGroups::getGroup( $extension );
624 } elseif ( $extension ==
'flaggedrevs' ) {
625 foreach ( MessageGroups::singleton()->getGroups()
as $group ) {
626 if ( strpos( $group->getId(),
'ext-flaggedrevs-' ) === 0 && !$group->isMeta() ) {
633 $group = MessageGroups::getGroup(
'ext-' . $extension );
636 $this->extensions[] = $extension;
638 print "No such extension $extension.\n";
650 'untranslated',
'duplicate',
'obsolete',
'variables',
'empty',
'plural',
651 'whitespace',
'xhtml',
'chars',
'links',
'unbalanced',
669 'duplicate',
'obsolete',
'empty',
'whitespace',
'xhtml',
'chars',
677 protected function help() {
683 *
First parameter (mandatory): Extension
name, multiple extension
names
684 (separated
by commas),
"all" for all
the extensions,
"wikimedia" for
685 extensions used
by Wikimedia
or "flaggedrevs" for all FLaggedRevs
695 * easy: Do only
the easy checks, which can be treated
by non-speakers
of
698 Check codes (ideally, all
of them should result 0; all
the checks
are executed
702 * duplicate: Messages which translation equal to fallback.
703 * obsolete: Messages which
are untranslatable, but translated.
704 * variables: Messages without variables which should be
used,
or with
705 variables which should
not be used.
707 * whitespace: Messages which have trailing whitespace.
708 * xhtml: Messages which
are not well-formed XHTML (checks only few common
710 * chars: Messages with hidden characters.
712 * unbalanced: Messages which contains unequal numbers
of opening {[
and
715 Display levels (
default: 2):
716 * 0: Skip
the checks (useful for checking syntax).
740 foreach ( $this->extensions
as $extension ) {
741 $this->L = $extension;
743 $this->results[
$code] = parent::checkLanguage(
$code );
746 echo $extension->name() .
":\n";
748 if ( $this->level > 0 ) {
749 switch ( $this->
output ) {
757 throw new MWException(
"Invalid output type $this->output" );
772 'code' => [
'az',
'bo',
'cdo',
'dz',
'id',
'fa',
'gan',
'gan-hans',
773 'gan-hant',
'gn',
'hak',
'hu',
'ja',
'jv',
'ka',
'kk-arab',
774 'kk-cyrl',
'kk-latn',
'km',
'kn',
'ko',
'lzh',
'mn',
'ms',
775 'my',
'sah',
'sq',
'tet',
'th',
'to',
'tr',
'vi',
'wuu',
'xmf',
776 'yo',
'yue',
'zh',
'zh-classical',
'zh-cn',
'zh-hans',
777 'zh-hant',
'zh-hk',
'zh-sg',
'zh-tw',
'zh-yue'
#define the
table suitable for use with IDatabase::select()
you don t have to do a grep find to see where the $wgReverseTitle variable is used
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global then executing the whole list after the page is displayed We don t do anything smart like collating updates to the same table or such because the list is almost always going to have just one item on if that
null means default in associative array form
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
the array() calling protocol came about after MediaWiki 1.4rc1.
getDescriptions()
Get all check descriptions.
per default it will return the text for text based content
doChecks()
Execute the checks.
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()
Execute the script.
easyChecks()
Get the checks that can easily be treated by non-speakers of the language.
globals txt Globals are evil The original MediaWiki code relied on globals for processing context far too often MediaWiki development since then has been a story of slowly moving context out of global variables and into objects Storing processing context in object member variables allows those objects to be reused in a much more flexible way Consider the elegance of
database rows
null for the local wiki Added in
isEmpty()
Check if there are any results for the checks, in any language.
when a variable name is used in a it is silently declared as a new local masking the global
nonMessageChecks()
Get the checks which check other things than messages.
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning maintenance scripts have been cleaned up to use a unified class Directory structure How to run a script How to write your own DIRECTORY STRUCTURE The maintenance directory of a MediaWiki installation contains several all of which have unique purposes HOW TO RUN A SCRIPT Ridiculously just call php someScript php that s in the top level maintenance directory if not default wiki
The ContentHandler facility adds support for arbitrary content types on wiki instead of relying on wikitext for everything It was introduced in MediaWiki Each kind of and so on Built in content types are
passed in as a query string parameter to the various URLs constructed here(i.e.$prevlink) $ldel you ll need to handle error messages
An extension or a local will often add custom code to the function with or without a global variable For someone wanting email notification when an article is shown may add
I won t presume to tell you how to I m just describing the methods I chose to use for myself If you do choose to follow these it will probably be easier for you to collaborate with others on the project
This document describes the XML format used to represent information about external sites known to a MediaWiki installation This information about external sites is used to allow inter wiki links
in the order they appear.
$wgLanguageCode
Site language code.
formatKey($key, $code)
Format a message key.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation 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 message
isCheckBlacklisted($check, $code, $message)
Verify whether a check is blacklisted.
The ContentHandler facility adds support for arbitrary content types on wiki instead of relying on wikitext for everything It was introduced in MediaWiki Each kind of and so on Built in content types as usual *javascript user provided javascript code *json simple implementation for use by extensions
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely the Work and Derivative Works thereof Contribution shall mean any work of including the original version of the Work and any modifications or additions to that Work or Derivative Works that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner For the purposes of this submitted means any form of or written communication sent to the Licensor or its including but not limited to communication on electronic mailing source code control and issue tracking systems that are managed or on behalf the Licensor for the purpose of discussing and improving the but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution Contributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work Grant of Copyright License Subject to the terms and conditions of this each Contributor hereby grants to You a non no royalty irrevocable copyright license to prepare Derivative Works publicly publicly perform
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 etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add headers
checkLanguage($code)
Check a language and show the results.
execute()
Execute the script.
getTotalCount()
Get total count for each check non-messages check.
and(b) You must cause any modified files to carry prominent notices stating that You changed the files
easyChecks()
Get the checks that can easily be treated by non-speakers of the language.
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely the Work and Derivative Works thereof Contribution shall mean any work of including the original version of the Work and any modifications or additions to that Work or Derivative Works that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner For the purposes of this submitted means any form of or written communication sent to the Licensor or its including but not limited to communication on electronic mailing source code control and issue tracking systems that are managed by
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 broken
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration settings
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
static fetchLanguageName($code, $inLanguage=null, $include= 'all')
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had 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 were
nonMessageChecks()
Get the checks which check other things than messages.
if the prop value should be in the metadata multi language array can modify can modify indexed by page_id indexed by prefixed DB keys can modify can modify can modify this should be populated with an alert message to that effect to be fed to an HTMLForm object and populate $result with the reason in the form of error messages should be plain text with no special etc to show that they re errors
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive false for true for descending in case the handler function wants to provide a converted Content object Note that $result getContentModel() must return $toModel. 'CustomEditor'$rcid is used in generating this variable which contains information about the new such as the revision s whether the revision was marked as a minor edit or not
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning maintenance scripts have been cleaned up to use a unified class Directory structure How to run a script How to write your own DIRECTORY STRUCTURE The maintenance directory of a MediaWiki installation contains several all of which have unique purposes HOW TO RUN A SCRIPT Ridiculously just call php someScript php that s in the top level maintenance directory if not default do this many per batch HOW TO WRITE YOUR OWN Make a file in the maintenance directory called myScript php or something In write the following
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 and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same so they can t rely on Unix and must forbid reads to even standard directories like tmp lest users read each others files We cannot assume that the user has the ability to install or run any programs not written as web accessible PHP scripts Since anything that works on cheap shared hosting will work if you have shell or root access MediaWiki s design is based around catering to the lowest common denominator Although we support higher end setups as the way many things work by default is tailored toward shared hosting These defaults are unconventional from the point of view of and they certainly aren t ideal for someone who s installing MediaWiki as MediaWiki does not conform to normal Unix filesystem layout Hopefully we ll offer direct support for standard layouts in the but for now *any change to the location of files is unsupported *Moving things and leaving symlinks will *probably *not break but it is *strongly *advised not to try any more intrusive changes to get MediaWiki to conform more closely to your filesystem hierarchy Any such attempt will almost certainly result in unnecessary bugs The standard recommended location to install relative to the web is it should be possible to enable the appropriate rewrite rules by default
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
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 or an object and a method hook function The function part of a third party developers and local administrators to define code that will be run at certain points in the mainline code
The ContentHandler facility adds support for arbitrary content types on wiki pages
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
defaultChecks()
Get the default checks.
I won t presume to tell you how to I m just describing the methods I chose to use for myself If you do choose to follow these it will probably be easier for you to collaborate with others on the but if you want to contribute without by all means do which work well I also use K &R brace matching style I know that s a religious issue for so if you want to use a style that puts opening braces on the next line
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely the Work and Derivative Works thereof Contribution shall mean any work of including the original version of the Work and any modifications or additions to that Work or Derivative Works that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner For the purposes of this submitted means any form of or written communication sent to the Licensor or its including but not limited to communication on electronic mailing source code control and issue tracking systems that are managed or on behalf the Licensor for the purpose of discussing and improving the but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution Contributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work Grant of Copyright License Subject to the terms and conditions of this each Contributor hereby grants to You a non no royalty irrevocable copyright license to prepare Derivative Works publicly display
Class to extract and validate Exif data from jpeg (and possibly tiff) files.
__construct(array $options)
Constructor.
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 etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling output() to send it all.It could be easily changed to send incrementally if that becomes useful
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going on
Returning false makes less sense for events where the action is complete
checkLanguage($code)
Check a language.
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 which defines all default service and specifies how they depend on each other("wiring").When a new service is added to MediaWiki core
__construct(array $options, $extension)
Constructor.
static getVersion($flags= '', $lang=null)
Return a string of the MediaWiki version with Git revision if available.
outputWiki()
Output the checks results as wiki text.
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible values
outputText()
Output the checks results as plain text.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk page
within a display generated by the Derivative if and wherever such third party notices normally appear The contents of the NOTICE file are for informational purposes only and do not modify the License You may add Your own attribution notices within Derivative Works that You alongside or as an addendum to the NOTICE text from the provided that such additional attribution notices cannot be construed as modifying the License You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for or distribution of Your or for any such Derivative Works as a provided Your and distribution of the Work otherwise complies with the conditions stated in this License Submission of Contributions Unless You explicitly state any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this without any additional terms or conditions Notwithstanding the nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions Trademarks This License does not grant permission to use the trade names
defaultChecks()
Get the default checks.
getCheckBlacklist()
Get the check blacklist.
getChecks()
Get all checks.
in this case you re responsible for computing and outputting the entire conflict i the difference between revisions and your text headers and sections and Diff overridable Default is either copyrightwarning or copyrightwarning2 overridable Default is editpage tos summary such as anonymity and the real check