<?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
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
<?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;
<?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();
<?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();
<?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();
<?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
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
/**
+ * Maintenance script that imports XML dump files into the current wiki.
+ *
* @ingroup Maintenance
*/
class BackupReader extends Maintenance {
<?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
<?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
<?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();
$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 ) {
}
$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' ) {
$this->output( "Fetching new batch from {$data['apfrom']}\n" );
}
} while ( isset( $result['query-continue'] ) );
-
+
return $pages;
-
+
}
}
<?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
<?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();
<?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
* 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 ) ) {
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();