MediaWiki  master
README
Go to the documentation of this file.
1 == MediaWiki Maintenance ==
2 
3 The .sql scripts in this directory are not intended to be run standalone,
4 although this is appropriate in some cases, e.g. manual creation of blank tables
5 prior to an import.
6 
7 Most of the PHP scripts need to be run from the command line. Prior to doing so,
8 ensure that the LocalSettings.php file in the directory above points to the
9 proper installation.
10 
11 Certain scripts will require elevated access to the database. In order to
12 provide this, first create a MySQL user with "all" permissions on the wiki
14 LocalSettings.php
15 
16 === Brief explanation of files ===
17 
18 A lot of the files in this directory are PHP scripts used to perform various
19 maintenance tasks on the wiki database, e.g. rebuilding link tables, updating
20 the search indices, etc. The files in the "archives" directory are used to
21 upgrade the database schema when updating the software. Some schema definitions
22 for alternative (as yet unsupported) database management systems are stored
23 here too.
24 
25 The "storage" directory contains scripts and resources useful for working with
26 external storage clusters, and are not likely to be particularly useful to the
27 vast majority of installations. This directory does contain the compressOld
28 scripts, however, which can be useful for compacting old data.
29 
30 === Maintenance scripts ===
31 
32 As noted above, these should be run from the command line. Not all scripts are
33 listed, as some are Wikimedia-specific, and some are not applicable to most
34 installations.
35 
36  changePassword.php
37  Reset the password of a specified user
38 
39  cleanupSpam.php
40  Mass-revert insertion of linkspam
41 
42  createAndPromote.php
43  Create a user with administrator (and optionally, bureaucrat) permissions
44 
45  deleteOldRevisions.php
46  Erase old revisions of pages from the database
47 
48  dumpBackup.php
49  Backup dump script
50 
51  edit.php
52  Edit a page to change its content
53 
54  findHooks.php
55  Find hooks that aren't documented in docs/hooks.txt
56 
57  importDump.php
58  XML dump importer
59 
60  importImages.php
61  Import images into the wiki
62 
63  moveBatch.php
64  Move a batch of pages
65 
66  namespaceDupes.php
67  Check articles name to see if they conflict with new/existing namespaces
68 
69  nukePage.php
70  Wipe a page and all revisions from the database
71 
72  reassignEdits.php
73  Reassign edits from one user to another
74 
75  rebuildImages.php
76  Update image metadata records
77 
78  rebuildmessages.php
79  Update the MediaWiki namespace after changing site language
80 
81  rebuildtextindex.php
82  Rebuild the fulltext search indices
83 
84  refreshLinks.php
85  Rebuild the link tables
86 
87  removeUnusedAccounts.php
88  Remove user accounts which have made no edits
89 
90  runJobs.php
91  Immediately complete all jobs in the job queue
92 
93  undelete.php
94  Undelete all revisions of a page
95 
96  update.php
97  Check and upgrade the database schema to the current version
98 
99  updateRestrictions.php
100  Update pages restriction to the new schema
101 
102  userOptions.php
103  Change user options
#define the
table suitable for use with IDatabase::select()
For QUnit the mediawiki tests qunit testrunner dependency will be added to any module it s the URL of the revision text in external storage
Definition: hooks.txt:2581
you don t have to do a grep find to see where the $wgReverseTitle variable is used
Definition: hooks.txt:117
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
Definition: deferred.txt:11
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 order
Definition: design.txt:12
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing so
Definition: README:1
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 that s OK too
Definition: design.txt:79
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 some
Definition: design.txt:79
to move a page</td >< td > &*You are moving the page across namespaces
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link updating the search etc The files in the archives directory are used to upgrade the database schema when updating the software Some schema definitions for alternative(as yet unsupported) database management systems are stored here too.The"storage"directory contains scripts and resources useful for working with external storage clusters
$wgDBadminpassword
Separate password for maintenance tasks.
per default it will return the text for text based content
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 etc *css user provided css code *text plain text In PHP
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
Definition: globals.txt:10
null for the local wiki Added in
Definition: hooks.txt:1435
The most up to date schema for the tables in the database will always be tables sql in the maintenance directory
Definition: schema.txt:2
The MediaWiki class is the helper class for the index.php entry point.
Definition: MediaWiki.php:28
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
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 create
Definition: hooks.txt:2376
in this case you re responsible for computing and outputting the entire conflict i e
Definition: hooks.txt:1256
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a batch
Definition: linkcache.txt:14
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link updating the search etc The files in the archives directory are used to upgrade the database schema when updating the software Some schema definitions for and are not likely to be particularly useful to the vast majority of installations This directory does contain the compressOld which can be useful for compacting old data
Definition: README:30
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
Definition: maintenance.txt:1
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
Prior to version
Definition: maintenance.txt:1
</td >< td > this can then be imported into another wiki running MediaWiki software
Some quick notes on the file repository architecture Functionality is
Definition: README:3
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link updating the search etc The files in the archives directory are used to upgrade the database schema when updating the software Some schema definitions for and are not likely to be particularly useful to the vast majority of installations This directory does contain the compressOld scripts
Definition: README:28
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
Definition: hooks.txt:93
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 etc
Definition: design.txt:12
it s the revision text itself In either if gzip is set
Definition: hooks.txt:2588
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 user
Wikitext formatted, in the key only.
Definition: distributors.txt:9
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 so it s not worth the trouble Since there is a job queue in the jobs which is used to update link tables of transcluding pages after edits
Definition: deferred.txt:11
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 systems
and(b) You must cause any modified files to carry prominent notices stating that You changed the files
Some information about database access in MediaWiki By Tim January Database layout For information about the MediaWiki database such as a description of the tables and their please see
Definition: database.txt:2
The various manual files contains special mappings not included in the unihan and phrases not included in the SCIM package symme_supp manual
Definition: README:2
Using a hook running we can avoid having all this option specific stuff in our mainline code Using hooks
Definition: hooks.txt:73
If this is not the you may have found a bug in the software Please report this to an administrator
and *available in your language For system installation
Definition: README:16
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 and distribute the Work and such Derivative Works in Source or Object form Grant of Patent License Subject to the terms and conditions of this each Contributor hereby grants to You a non no royalty have made
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
Definition: distributors.txt:9
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 stored
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 above
if($IP===false)
Definition: WebStart.php:59
or there are no hooks to run
Definition: hooks.txt:223
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 change
Definition: distributors.txt:9
Some quick notes on the file repository architecture Functionality as driven by data model *The repository object stores configuration information about a file storage method *The file object is a process local cache of information about a particular file Thus the file object is the primary public entry point for obtaining information about files
Definition: README:3
The ContentHandler facility adds support for arbitrary content types on wiki pages
$wgDBadminuser
Separate username for maintenance tasks.
unless you explicitly specified the no dev flag during the install In this case just run composer update Otherwise follow the installation instructions in the PHPUnit Manual the tests runs are controlled with a makefile Run command
Definition: README:1
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
Definition: design.txt:12
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 permissions
Definition: distributors.txt:9
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
Definition: design.txt:79
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link tables
Definition: README:16
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
Definition: hooks.txt:2755
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link updating the search etc The files in the archives directory are used to upgrade the database schema when updating the software Some schema definitions for and are not likely to be particularly useful to the vast majority of installations This directory does contain the compressOld however
Definition: README:28
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without restriction
Definition: LICENSE.txt:10
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
Definition: hooks.txt:86
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link updating the search indices
Definition: README:16
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link updating the search etc The files in the archives directory are used to upgrade the database schema when updating the software Some schema definitions for and are not likely to be particularly useful to the vast majority of installations This directory does contain the compressOld which can be useful for compacting old these should be run from the command line Not all scripts are as some are Wikimedia specific
Definition: README:30
Returning false makes less sense for events where the action is complete
Definition: hooks.txt:199
</td >< td > &</td >< td > t want your writing to be edited mercilessly and redistributed at will
maintenance dev scripts can help quickly setup a local MediaWiki for development purposes Wikis setup in this way are NOT meant to be publicly available They use a development database not acceptible for use in production Place a sqlite database in an unsafe location a real wiki should never place it in And use predictable default logins for the initial administrator user Running maintenance dev install sh will download and install a local copy of php
Definition: README:5
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 then
Definition: skin.txt:10
The various manual files contains special mappings not included in the unihan database
Definition: README:2
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
Definition: hooks.txt:2376
although this is appropriate in some cases
Definition: README:1
although this is appropriate in some e g manual creation of blank tables prior to an import Most of the PHP scripts need to be run from the command line Prior to doing ensure that the LocalSettings php file in the directory above points to the proper installation Certain scripts will require elevated access to the database In order to provide first create a MySQL user with all permissions on the wiki and then set $wgDBadminuser and $wgDBadminpassword in your LocalSettings e g rebuilding link updating the search etc The files in the archives directory are used to upgrade the database schema when updating the software Some schema definitions for and are not likely to be particularly useful to the vast majority of installations This directory does contain the compressOld which can be useful for compacting old these should be run from the command line Not all scripts are listed
Definition: README:30