diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
commit | 370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch) | |
tree | 491674f4c242e4d6ba0d04eafa305174c35a3391 /maintenance/populateCategory.php | |
parent | f4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff) |
Update auf 1.13.0
Diffstat (limited to 'maintenance/populateCategory.php')
-rw-r--r-- | maintenance/populateCategory.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php new file mode 100644 index 00000000..cb22e7f8 --- /dev/null +++ b/maintenance/populateCategory.php @@ -0,0 +1,52 @@ +<?php +/** + * @file + * @ingroup Maintenance + * @author Simetrical + */ + +$optionsWithArgs = array( 'begin', 'max-slave-lag', 'throttle' ); + +require_once "commandLine.inc"; +require_once "populateCategory.inc"; + +if( isset( $options['help'] ) ) { + echo <<<TEXT +This script will populate the category table, added in MediaWiki 1.13. It will +print out progress indicators every 1000 categories it adds to the table. The +script is perfectly safe to run on large, live wikis, and running it multiple +times is harmless. You may want to use the throttling options if it's causing +too much load; they will not affect correctness. + +If the script is stopped and later resumed, you can use the --begin option with +the last printed progress indicator to pick up where you left off. This is +safe, because any newly-added categories before this cutoff will have been +added after the software update and so will be populated anyway. + +When the script has finished, it will make a note of this in the database, and +will not run again without the --force option. + +Usage: + php populateCategory.php [--max-slave-lag <seconds>] [--begin <name>] +[--throttle <seconds>] [--force] + + --begin: Only do categories whose names are alphabetically after the pro- +vided name. Default: empty (start from beginning). + --max-slave-lag: If slave lag exceeds this many seconds, wait until it +drops before continuing. Default: 10. + --throttle: Wait this many milliseconds after each category. Default: 0. + --force: Run regardless of whether the database says it's been run already. +TEXT; + exit( 0 ); +} + +$defaults = array( + 'begin' => '', + 'max-slave-lag' => 10, + 'throttle' => 0, + 'force' => false +); +$options = array_merge( $defaults, $options ); + +populateCategory( $options['begin'], $options['max-slave-lag'], + $options['throttle'], $options['force'] ); |