Improve documentation of maintenance scripts.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 17 Jul 2012 05:40:40 +0000 (07:40 +0200)
committerAntoine Musso <hashar@free.fr>
Tue, 24 Jul 2012 16:10:43 +0000 (18:10 +0200)
Change-Id: If0af9922ede902c2c6f18b627d5810f3e888c944

14 files changed:
maintenance/deleteBatch.php
maintenance/edit.php
maintenance/fixSlaveDesync.php
maintenance/generateSitemap.php
maintenance/getLagTimes.php
maintenance/getSlaveServer.php
maintenance/getText.php
maintenance/importDump.php
maintenance/importImages.inc
maintenance/importImages.php
maintenance/importSiteScripts.php
maintenance/importTextFile.php
maintenance/initStats.php
maintenance/install.php

index 2a99fa1..6860a5a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Deletes a batch of pages
+ * Deletes a batch of pages.
  * Usage: php deleteBatch.php [-u <user>] [-r <reason>] [-i <interval>] [listfile]
  * where
  *     [listfile] is a file where each line contains the title of a page to be
index 211dc4e..13b3c49 100644 (file)
@@ -17,6 +17,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  */
 
index de6f652..126eed2 100644 (file)
@@ -17,6 +17,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  */
 
index 7e83d5f..a81e3d9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Creates a sitemap for the site
+ * Creates a sitemap for the site.
  *
  * Copyright © 2005, Ævar Arnfjörð Bjarmason, Jens Frank <jeluf@gmx.de> and
  * Brion Vibber <brion@pobox.com>
 
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
+/**
+ * Maintenance script that generates a sitemap for the site.
+ *
+ * @ingroup Maintenance
+ */
 class GenerateSitemap extends Maintenance {
        const GS_MAIN = -2;
        const GS_TALK = -1;
index 0322fa2..c47c61e 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 /**
+ * Display replication lag times.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  */
 
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
+/**
+ * Maintenance script that displays replication lag times.
+ *
+ * @ingroup Maintenance
+ */
 class GetLagTimes extends Maintenance {
        public function __construct() {
                parent::__construct();
index 3d13bc4..0270052 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * This script reports the hostname of a slave server.
+ * Reports the hostname of a slave server.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  */
 
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
+/**
+ * Maintenance script that reports the hostname of a slave server.
+ *
+ * @ingroup Maintenance
+ */
 class GetSlaveServer extends Maintenance {
        public function __construct() {
                parent::__construct();
index eb04411..34558b6 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
- * Outputs page text to stdout, useful for command-line editing automation.
+ * Outputs page text to stdout.
+ * Useful for command-line editing automation.
  * Example: php getText.php "page title" | sed -e '...' | php edit.php "page title"
  *
  * This program is free software; you can redistribute it and/or modify
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  */
 
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
+/**
+ * Maintenance script that outputs page text to stdout.
+ *
+ * @ingroup Maintenance
+ */
 class GetTextMaint extends Maintenance {
        public function __construct() {
                parent::__construct();
index 2ad0872..b6e0fe0 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- * Copyright (C) 2005 Brion Vibber <brion@pobox.com>
+ * Import XML dump files into the current wiki.
+ *
+ * Copyright © 2005 Brion Vibber <brion@pobox.com>
  * http://www.mediawiki.org/
  *
  * This program is free software; you can redistribute it and/or modify
@@ -25,6 +27,8 @@
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 /**
+ * Maintenance script that imports XML dump files into the current wiki.
+ *
  * @ingroup Maintenance
  */
 class BackupReader extends Maintenance {
index 5eb68f2..ac5d144 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Support functions for the importImages script
+ * Support functions for the importImages.php script
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index bd077ff..76ec565 100644 (file)
@@ -1,8 +1,7 @@
 <?php
-
 /**
- * Maintenance script to import one or more images from the local file system into
- * the wiki without using the web-based interface.
+ * Import one or more images from the local file system into the wiki without
+ * using the web-based interface.
  *
  * "Smart import" additions:
  * - aim: preserve the essential metadata (user, description) when importing medias from an existing wiki
index 0ce9388..65ac65a 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 /**
- * Maintenance script to import all scripts in the MediaWiki namespace from a
- * local site.
+ * Import all scripts in the MediaWiki namespace from a local site.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
+/**
+ * Maintenance script to import all scripts in the MediaWiki namespace from a
+ * local site.
+ *
+ * @ingroup Maintenance
+ */
 class ImportSiteScripts extends Maintenance {
        public function __construct() {
                parent::__construct();
@@ -32,17 +37,17 @@ class ImportSiteScripts extends Maintenance {
                $this->addArg( 'index', 'index.php base url' );
                $this->addOption( 'username', 'User name of the script importer' );
        }
-       
+
        public function execute() {
                global $wgUser;
 
                $user = User::newFromName( $this->getOption( 'username', 'ScriptImporter' ) );
                $wgUser = $user;
-               
+
                $baseUrl = $this->getArg( 1 );
                $pageList = $this->fetchScriptList();
                $this->output( 'Importing ' . count( $pageList ) . " pages\n" );
-               
+
                foreach ( $pageList as $page ) {
                        $title = Title::makeTitleSafe( NS_MEDIAWIKI, $page );
                        if ( !$title ) {
@@ -51,34 +56,34 @@ class ImportSiteScripts extends Maintenance {
                        }
 
                        $this->output( "Importing $page\n" );
-                       $url = wfAppendQuery( $baseUrl, array( 
-                               'action' => 'raw', 
+                       $url = wfAppendQuery( $baseUrl, array(
+                               'action' => 'raw',
                                'title' => "MediaWiki:{$page}" ) );
                        $text = Http::get( $url );
 
                        $wikiPage = WikiPage::factory( $title );
                        $wikiPage->doEdit( $text, "Importing from $url", 0, false, $user );
                }
-               
+
        }
-       
+
        protected function fetchScriptList() {
-               $data = array( 
+               $data = array(
                        'action' => 'query',
                        'format' => 'php',//'json',
                        'list' => 'allpages',
                        'apnamespace' => '8',
-                       'aplimit' => '500', 
+                       'aplimit' => '500',
                );
                $baseUrl = $this->getArg( 0 );
                $pages = array();
-               
+
                do {
                        $url = wfAppendQuery( $baseUrl, $data );
                        $strResult = Http::get( $url );
                        //$result = FormatJson::decode( $strResult ); // Still broken
                        $result = unserialize( $strResult );
-                       
+
                        if ( !empty( $result['query']['allpages'] ) ) {
                                foreach ( $result['query']['allpages'] as $page ) {
                                        if ( substr( $page['title'], -3 ) === '.js' ) {
@@ -92,9 +97,9 @@ class ImportSiteScripts extends Maintenance {
                                $this->output( "Fetching new batch from {$data['apfrom']}\n" );
                        }
                } while ( isset( $result['query-continue'] ) );
-               
+
                return $pages;
-               
+
        }
 }
 
index ec9ff00..5623fb0 100644 (file)
@@ -1,8 +1,6 @@
 <?php
-
 /**
- * Maintenance script allows creating or editing pages using
- * the contents of a text file
+ * Create or edit pages using the contents of a text file.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index eab9c8d..35918bb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Maintenance script to re-initialise or update the site statistics table
+ * Re-initialise or update the site statistics table.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
+/**
+ * Maintenance script to re-initialise or update the site statistics table
+ *
+ * @ingroup Maintenance
+ */
 class InitStats extends Maintenance {
        public function __construct() {
                parent::__construct();
index 8e0b2e1..6339773 100644 (file)
@@ -1,6 +1,7 @@
 <?php
-
 /**
+ * CLI-based MediaWiki installation and configuration.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -16,8 +17,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
- * @see wfWaitForSlaves()
  */
 
 if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.3.2' ) < 0 ) ) {
@@ -31,6 +32,11 @@ define( 'MEDIAWIKI_INSTALL', true );
 
 require_once( dirname( dirname( __FILE__ ) )."/maintenance/Maintenance.php" );
 
+/**
+ * Maintenance script to install and configure MediaWiki
+ *
+ * @ingroup Maintenance
+ */
 class CommandLineInstaller extends Maintenance {
        function __construct() {
                parent::__construct();