* @subpackage Maintenance
*/
-
+/** */
function initialiseMessages( $overwrite = false, $messageArray = false ) {
global $wgContLang, $wgContLanguageCode;
global $wgContLangClass, $wgAllMessagesEn;
}
}
}
-
initialiseMessagesReal( $overwrite, $messages );
}
-
-
-
-
-
-
/** */
function initialiseMessagesReal( $overwrite = false, $messageArray = false ) {
global $wgContLang, $wgScript, $wgServer, $wgAllMessagesEn;
print "Done.\n";
}
-function loadLanguageFile( $filename )
-{
+/** */
+function loadLanguageFile( $filename ) {
$contents = file_get_contents( $filename );
# Remove header line
$p = strpos( $contents, "\n" ) + 1;
return unserialize( $contents );
}
+/** */
function doUpdates() {
global $wgDeferredUpdateList;
foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }
}
-
-?>
+?>
\ No newline at end of file
<?php
+/**
+ * Squid purge benchmark script
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
-/* Squid purge benchmark script */
-
+/** */
require_once( "commandLine.inc" );
+/** @todo document */
function benchSquid( $urls, $trials = 1 ) {
$start = wfTime();
for( $i = 0; $i < $trials; $i++) {
count( $urls ), $pertrial * 1000.0, $pertitle * 1000.0 );
}
+/** @todo document */
function randomUrlList( $length ) {
$list = array();
for( $i = 0; $i < $length; $i++ ) {
return $list;
}
+/** @todo document */
function randomUrl() {
global $wgServer, $wgArticlePath;
return $wgServer . str_replace( '$1', randomTitle(), $wgArticlePath );
}
+/** @todo document */
function randomTitle() {
$str = '';
$length = mt_rand( 1, 20 );
print "$trial\n";
}
}
-
-?>
+?>
\ No newline at end of file
<?php
+/**
+ * This script is used to clear the interwiki links for ALL languages in
+ * memcached.
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
require_once('commandLine.inc');
foreach ( $wgLocalDatabases as $db ) {
}
}
print "\n";
-?>
+?>
\ No newline at end of file
<?php
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
require_once('commandLine.inc');
foreach ( $wgLocalDatabases as $db ) {
noisyDelete("$db:stats:pcache_miss_absent");
}
+/** @todo document */
function noisyDelete( $key ) {
global $wgMemc;
/*
}*/
$wgMemc->delete($key);
}
-?>
+?>
\ No newline at end of file
* @subpackage Maintenance
*/
+/** */
require_once( '../includes/Revision.php' );
-/** */
+/** @todo document */
function compressOldPages( $start = 0 ) {
$fname = 'compressOldPages';
} while( true );
}
+/** @todo document */
function compressPage( $row ) {
$fname = 'compressPage';
if( false !== strpos( $row->old_flags, "gzip" ) ) {
define( 'LS_INDIVIDUAL', 0 );
define( 'LS_CHUNKED', 1 );
+/** @todo document */
function compressWithConcat( $startId, $maxChunkSize, $maxChunkFactor, $factorThreshold, $beginDate, $endDate )
{
$fname = 'compressWithConcat';
}
return true;
}
-
-?>
+?>
\ No newline at end of file
die("This file is not complete; it's checked in so I don't forget it.");
-/*
-UTF-8 conversion of DOOOOOOOM
-
-1. Lock the wiki
-2. Make a convertlist of all pages
-3. Enable CONVERTLOCK mode and switch to UTF-8
-4. As quick as possible, convert the cur, images, *links, user, etc tables. Clear cache tables.
-5. Unlock the wiki. Attempts to access pages on the convertlist will be trapped to read-only.
-6. Go through the list, fixing up old revisions. Remove pages from the convertlist.
-*/
-
-
+/**
+ * UTF-8 conversion of DOOOOOOOM
+ *
+ * 1. Lock the wiki
+ * 2. Make a convertlist of all pages
+ * 3. Enable CONVERTLOCK mode and switch to UTF-8
+ * 4. As quick as possible, convert the cur, images, *links, user, etc tables.
+ * Clear cache tables.
+ * 5. Unlock the wiki. Attempts to access pages on the convertlist will be
+ * trapped to read-only.
+ * 6. Go through the list, fixing up old revisions. Remove pages from the
+ * convertlist.
+ */
class UtfUpdater {
+ /** Constructor, set the database */
function UtfUpdater() {
$this->db =& wfGetDB( DB_MASTER );
}
-
+
+ /**
+ * @param string $string A string to be converted to UTF-8
+ */
function toUtf8( $string ) {
if( function_exists( 'iconv' ) ) {
# There are likely to be Windows code page 1252 chars in there.
}
}
+ /**
+ * Truncate a table.
+ * @param string $table The table name to be truncated
+ */
function clearTable( $table ) {
print "Clearing $table...\n";
$tableName = $this->db->tableName( $table );
$this->db->freeResult( $res );
}
+ /**
+ * Lock tables.
+ * @param array $tables An array of table to be locked.
+ */
function lockTables( $tables ) {
$query = '';
foreach( $tables as $table ) {
}
$this->db->query( 'LOCK TABLES ' . $query );
}
-
+
+ /**
+ * @todo document
+ */
function updateAll() {
$this->lockTables( array(
'linkscc', 'objectcache', 'searchindex', 'querycache',
}
}
-
-?>
+?>
\ No newline at end of file
<?php
-
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
error_reporting(E_ALL);
+/** */
require_once( "commandLine.inc" );
require_once( 'includes/SpecialExport.php' );
+/** */
function dumpReplayLog( $start ) {
$dbw =& wfGetDB( DB_MASTER );
$recentchanges = $dbw->tableName( 'recentchanges' );
$dbw->freeResult( $result );
}
+/** */
function dumpReplayEntry( $row ) {
$title = Title::MakeTitle( $row->rc_namespace, $row->rc_title );
switch( $row->rc_type ) {
-<?
+<?php
+/**
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
require_once( 'commandLine.inc' );
$dbr =& wfGetDB( DB_SLAVE );
$row = $dbr->selectRow( 'old', array( 'old_flags', 'old_text' ), array( 'old_id' => 52 ) );
$obj = unserialize( $row->old_text );
print_r( array_keys( $obj->mItems ) );
-
-?>
+?>
\ No newline at end of file
require_once( "$IP/includes/ObjectCache.php" );
require_once( "$IP/languages/LanguageUtf8.php" );
-/** */
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
class ParserTest {
/**
* boolean $color whereas output should be colorized
exit ($ok ? 0 : -1);
-?>
+?>
\ No newline at end of file
<?php
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
require_once('commandLine.inc');
$hits = intval($wgMemc->get("$wgDBname:stats:pcache_hit"));
printf( "expired: %-10d %6.2f%%\n", $expired, $expired/$total*100 );
printf( "absent: %-10d %6.2f%%\n", $absent, $absent/$total*100 );
printf( "total: %-10d %6.2f%%\n", $total, 100 );
-?>
+?>
\ No newline at end of file
-<?
-
+<?php
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ * @todo document
+ */
$textsourcefile_web = "http://meta.wikipedia.org/w/index.php?title=PortalText&action=raw" ;
$textsourcefile = "t.txt" ;
#$articlecountfile_web = "http://magnusmanske.de/wikipedia/num.txt" ;
if ( isset ( $HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"] ) )
$userlang = $HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"] ;
-else $userlang = "" ;
+else $userlang = '' ;
# Update local files
if ( isset ( $_GET["update"] ) )
copy ( $articlecountfile_web , $articlecountfile ) ;
}
-# Reads a file into a string
+/**
+ * Reads a file into a string
+ */
function readafile ( $filename )
{
$handle = fopen($filename, "r");
return $contents ;
}
-# Parsing statistics file
+/** Parsing statistics file */
function get_numbers ( $filename )
{
$r = array () ;
return $r ;
}
-# Make shades for pref. language(s)
+/** Make shades for pref. language(s) */
function getshades ( $l )
{
$r = array () ;
$t = explode ( "\n" , $t ) ;
foreach ( $t AS $x )
{
- $y = explode ( ":" , $x , 2 ) ;
+ $y = explode ( ':' , $x , 2 ) ;
if ( count ( $y ) == 2 )
{
$language = trim ( strtolower ( $y[0] ) ) ; # language id