27 define(
'MW_PARSER_TEST',
true );
29 $options = [
'quick',
'color',
'quiet',
'help',
'show-output',
30 'record',
'run-disabled',
'run-parsoid',
'dwdiff',
'mark-ws' ];
33 require_once __DIR__ .
'/../maintenance/commandLine.inc';
34 require_once __DIR__ .
'/TestsAutoLoader.php';
42 --quick Suppress diff
output of failed tests
43 --quiet Suppress notification
of passed tests (shows only failed tests)
46 use wgCommandLineDarkBg =
true;
if your
term is dark
47 --regex Only
run tests whose descriptions which match given regex
48 --filter Alias
for --regex
49 --
file=<testfile> Run test
cases from a custom file instead
of parserTests.txt
51 --compare Compare with recorded results, without updating
the database.
53 with git-svn
so that you can
get the exact revision)
54 --keep-uploads Re-
use the same upload
directory for each test, don
't delete it
55 --fuzz Do a fuzz test instead of a normal test
56 --seed <n> Start the fuzz test from the specified seed
57 --run-disabled run disabled tests
58 --run-parsoid run parsoid tests (normally disabled)
59 --dwdiff Use dwdiff to display diff output
60 --mark-ws Mark whitespace in diffs by replacing it with symbols
61 --norm=<funcs> Apply a comma-separated list of normalization functions to
62 both the expected and actual output in order to resolve
63 irrelevant differences. The accepted normalization functions
64 are: removeTbody to remove <tbody> tags; and trimWhitespace
65 to trim whitespace from the start and end of text nodes.
66 --use-tidy-config Use the wiki's Tidy configuration instead
of known-good
74 # Cases of weird db corruption were encountered when running tests on earlyish
79 if ( version_compare(
$version,
'3.6' ) < 0 ) {
80 die(
"Parser tests require SQLite version 3.6 or later, you have $version\n" );
93 # Print out software version to assist with locating regressions
95 echo
"This is MediaWiki version {$version}.\n\n";
#define the
table suitable for use with IDatabase::select()
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
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
$wgParserTestFiles
Parser test suite files to be run by parserTests.php when no specific filename is passed to it...
$wgVersion
MediaWiki version number.
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 database
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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 from
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
if(isset($options['help'])) if($wgDBtype== 'sqlite') $tester
null for the local wiki Added in
The most up to date schema for the tables in the database will always be tables sql in the maintenance directory
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 options(say) and put it in one place.Instead of having little title-reversing if-blocks spread all over the codebase in showAnArticle
which are not or by specifying more than one search term(only pages containing all of the search terms will appear in the result).</td >< td >
Some quick notes on the file repository architecture Functionality is
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
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 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 after processing 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
it s the revision text itself In either if gzip is set
and(b) You must cause any modified files to carry prominent notices stating that You changed the files
in the sidebar</td >< td > font color
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
or there are no hooks to run
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
static getVersion($flags= '', $lang=null)
Return a string of the MediaWiki version with Git revision if available.
although this is appropriate in some cases