diff options
author | Chad Horohoe <demon@users.mediawiki.org> | 2009-06-24 02:02:37 +0000 |
---|---|---|
committer | Chad Horohoe <demon@users.mediawiki.org> | 2009-06-24 02:02:37 +0000 |
commit | 59b60fc31194b3b09bba2c95b8ddf85c3f9e81bb (patch) | |
tree | a93a622c1f9e5d577c8c3614c02dfc876b108afd /docs/maintenance.txt | |
parent | 67a31fd20082081506ea93387b4b442ed0127ced (diff) | |
download | mediawikicore-59b60fc31194b3b09bba2c95b8ddf85c3f9e81bb.tar.gz mediawikicore-59b60fc31194b3b09bba2c95b8ddf85c3f9e81bb.zip |
Merge maintenance-work branch:
* (bug 16322) Allow maint scripts to accept DB user/pass over input or params if no AdminSettings.php
* (bug 18768) Remove AdminSettings.php from MediaWiki core
* (bug 19157) createAndPromote error on bad password
* (bug 14201) Create AdminSettings.php during wiki installation, in the same way as LocalSettings.php
* Introduce new Maintenance class framework and port a good number of scripts over; the ones that are left are a little more complicated. Read the docs.
* Not deleting "unused" files yet, don't want to break everything at once :)
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/52336
Diffstat (limited to 'docs/maintenance.txt')
-rw-r--r-- | docs/maintenance.txt | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/docs/maintenance.txt b/docs/maintenance.txt new file mode 100644 index 000000000000..d46d12e27c6f --- /dev/null +++ b/docs/maintenance.txt @@ -0,0 +1,54 @@ +Prior to version 1.16, maintenance scripts were a hodgepodge of code that +had no cohesion or formal method of action. Beginning in 1.16, maintenance +scripts have been cleaned up to use a unified class. + +1. Directory structure +2. How to run a script +3. How to write your own + +1. DIRECTORY STRUCTURE + The /maintenance directory of a MediaWiki installation contains several +subdirectories, all of which have unique purposes. + +2. HOW TO RUN A SCRIPT + Ridiculously simple, just call 'php someScript.php' that's in the top- +level /maintenance directory. + +Example: + php clear_stats.php + +The following parameters are available to all maintenance scripts +--help : Print a help message +--quiet : Quiet non-error output +--dbuser : The database user to use for the script (if needed) +--dbpass : Same as above (if needed) + +3. HOW TO WRITE YOUR OWN +Make a file in the maintenance directory called myScript.php or something. +In it, write the following: + +==BEGIN== + +<?php + +require_once( "Maintenance.php" ); + +class DemoMaint extends Maintenance { + + public function __construct() { + parent::__construct(); + } + + protected function execute() { + } +} + +$maintClass = "DemoMaint"; +require_once( DO_MAINTENANCE ); + +==END== + +That's it. In the execute() method, you have access to all of the normal +MediaWiki functions, so you can get a DB connection, use the cache, etc. +For full docs on the Maintenance class, see the auto-generated docs at +http://svn.wikimedia.org/doc/classMaintenance.html
\ No newline at end of file |