<?php
/**
- * Dumb program that tries to get the memory usage
- * for each language file.
+ * Dumb program that tries to get the memory usage for each language 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
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup MaintenanceLanguage
*/
require_once( __DIR__ . '/../Maintenance.php' );
require_once( __DIR__ . '/languages.inc' );
+/**
+ * Maintenance script that tries to get the memory usage for each language file.
+ *
+ * @ingroup MaintenanceLanguage
+ */
class LangMemUsage extends Maintenance {
public function __construct() {
$memlast = $memstart = memory_get_usage();
$this->output( "Base memory usage: $memstart\n" );
-
+
foreach ( $langtool->getLanguages() as $langcode ) {
Language::factory( $langcode );
$memstep = memory_get_usage();
/**
* Simple lock server daemon that accepts lock/unlock requests
+ *
+ * @ingroup LockManager Maintenance
*/
class LockServerDaemon {
/** @var resource */
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
/**
* When using shared tables that are referenced by foreign keys on local
* tables you have to change the constraints on local tables.
- *
+ *
* The shared tables have to have GRANT REFERENCE on shared tables to local schema
* i.e.: GRANT REFERENCES (user_id) ON mwuser TO hubclient;
*/
public function execute() {
global $wgSharedDB, $wgSharedTables, $wgSharedPrefix, $wgDBprefix;
-
+
if ( $wgSharedDB == null ) {
$this->output( "Database sharing is not enabled\n" );
return;
}
-
+
$dbw = wfGetDB( DB_MASTER );
foreach ( $wgSharedTables as $table ) {
$stable = $dbw->tableNameInternal($table);
} else {
$ltable = "{$wgDBprefix}{$stable}" ;
}
-
+
$result = $dbw->query( "SELECT uc.constraint_name, uc.table_name, ucc.column_name, uccpk.table_name pk_table_name, uccpk.column_name pk_column_name, uc.delete_rule, uc.deferrable, uc.deferred
FROM user_constraints uc, user_cons_columns ucc, user_cons_columns uccpk
WHERE uc.constraint_type = 'R'
AND uccpk.constraint_name = uc.r_constraint_name
AND uccpk.table_name = '$ltable'" );
while (($row = $result->fetchRow()) !== false) {
-
+
$this->output( "Altering {$row['constraint_name']} ...");
-
+
try {
$dbw->query( "ALTER TABLE {$row['table_name']} DROP CONSTRAINT {$wgDBprefix}{$row['constraint_name']}" );
} catch (DBQueryError $exdb) {
throw $exdb;
}
}
-
+
$deleteRule = $row['delete_rule'] == 'NO ACTION' ? '' : "ON DELETE {$row['delete_rule']}";
- $dbw->query( "ALTER TABLE {$row['table_name']} ADD CONSTRAINT {$wgDBprefix}{$row['constraint_name']}
- FOREIGN KEY ({$row['column_name']})
- REFERENCES {$wgSharedDB}.$stable({$row['pk_column_name']})
+ $dbw->query( "ALTER TABLE {$row['table_name']} ADD CONSTRAINT {$wgDBprefix}{$row['constraint_name']}
+ FOREIGN KEY ({$row['column_name']})
+ REFERENCES {$wgSharedDB}.$stable({$row['pk_column_name']})
{$deleteRule} {$row['deferrable']} INITIALLY {$row['deferred']}" );
-
+
$this->output( "DONE\n" );
}
}
// ----------------------------------------------------------------------------------
/**
+ * Maintenance script to do various checks on external storage.
+ *
* @ingroup Maintenance ExternalStorage
*/
class CheckStorage {
require_once( __DIR__ . '/../Maintenance.php' );
+/**
+ * Maintenance script that compress the text of a wiki.
+ *
+ * @ingroup Maintenance ExternalStorage
+ */
class CompressOld extends Maintenance {
/**
* @todo document
<?php
/**
+ * Get the text of a revision, resolving external storage if needed.
+ *
* 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 ExternalStorage
*/
require_once( __DIR__ . '/../Maintenance.php' );
+/**
+ * Maintenance script that gets the text of a revision,
+ * resolving external storage if needed.
+ *
+ * @ingroup Maintenance ExternalStorage
+ */
class DumpRev extends Maintenance {
public function __construct() {
parent::__construct();
require_once( __DIR__ . '/../Maintenance.php' );
+/**
+ * Maintenance script to fix bug 20757.
+ *
+ * @ingroup Maintenance ExternalStorage
+ */
class FixBug20757 extends Maintenance {
var $batchSize = 10000;
var $mapCache = array();
<?php
-
/**
- * Show some statistics on the blob_orphans table, created with trackBlobs.php
+ * Show some statistics on the blob_orphans table, created with trackBlobs.php.
*
* 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 ExternalStorage
*/
+
require_once( __DIR__ . '/../Maintenance.php' );
+/**
+ * Maintenance script that shows some statistics on the blob_orphans table,
+ * created with trackBlobs.php.
+ *
+ * @ingroup Maintenance ExternalStorage
+ */
class OrphanStats extends Maintenance {
public function __construct() {
parent::__construct();
$job = RecompressTracked::newFromCommandLine( $args, $options );
$job->execute();
+/**
+ * Maintenance script that moves blobs indexed by trackBlobs.php to a specified
+ * list of destination clusters, and recompresses them in the process.
+ *
+ * @ingroup Maintenance ExternalStorage
+ */
class RecompressTracked {
var $destClusters;
var $batchSize = 1000;
<?php
/**
- * Script to convert history stubs that point to an external row to direct
- * external pointers.
+ * Convert history stubs that point to an external row to direct external
+ * pointers.
*
* 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
/**
+ * Test revision text compression and decompression.
+ *
* 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
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @ingroup Maintenance
- * @see wfWaitForSlaves()
+ * @ingroup Maintenance ExternalStorage
*/
$optionsWithArgs = array( 'start', 'limit', 'type' );