From 09f094a8090e2c5efb1dcd350f48683b9e8a3012 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 27 Jan 2005 23:25:16 +0000 Subject: [PATCH] fix phpdoc comment --- maintenance/InitialiseMessages.inc | 17 +++------- maintenance/benchmarkPurge.php | 15 ++++++--- maintenance/clear_interwiki_cache.php | 10 +++++- maintenance/clear_pcache_stats.php | 9 ++++- maintenance/compressOld.inc | 8 +++-- maintenance/convertUtf8.php | 47 ++++++++++++++++++--------- maintenance/dumpReplayLog.php | 8 ++++- maintenance/dumpRev.php | 12 +++++-- maintenance/parserTests.php | 7 ++-- maintenance/pcache_stats.php | 8 ++++- maintenance/portal.php | 20 ++++++++---- 11 files changed, 110 insertions(+), 51 deletions(-) diff --git a/maintenance/InitialiseMessages.inc b/maintenance/InitialiseMessages.inc index 98157705bf..cb821c0218 100755 --- a/maintenance/InitialiseMessages.inc +++ b/maintenance/InitialiseMessages.inc @@ -10,7 +10,7 @@ * @subpackage Maintenance */ - +/** */ function initialiseMessages( $overwrite = false, $messageArray = false ) { global $wgContLang, $wgContLanguageCode; global $wgContLangClass, $wgAllMessagesEn; @@ -69,16 +69,9 @@ function initialiseMessages( $overwrite = false, $messageArray = false ) { } } } - initialiseMessagesReal( $overwrite, $messages ); } - - - - - - /** */ function initialiseMessagesReal( $overwrite = false, $messageArray = false ) { global $wgContLang, $wgScript, $wgServer, $wgAllMessagesEn; @@ -217,8 +210,8 @@ function initialiseMessagesReal( $overwrite = false, $messageArray = false ) { print "Done.\n"; } -function loadLanguageFile( $filename ) -{ +/** */ +function loadLanguageFile( $filename ) { $contents = file_get_contents( $filename ); # Remove header line $p = strpos( $contents, "\n" ) + 1; @@ -227,9 +220,9 @@ function loadLanguageFile( $filename ) return unserialize( $contents ); } +/** */ function doUpdates() { global $wgDeferredUpdateList; foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); } } - -?> +?> \ No newline at end of file diff --git a/maintenance/benchmarkPurge.php b/maintenance/benchmarkPurge.php index 19cd88ccf6..9f45433aa0 100644 --- a/maintenance/benchmarkPurge.php +++ b/maintenance/benchmarkPurge.php @@ -1,9 +1,14 @@ +?> \ No newline at end of file diff --git a/maintenance/clear_interwiki_cache.php b/maintenance/clear_interwiki_cache.php index a16ba87fa6..ca26d73dec 100644 --- a/maintenance/clear_interwiki_cache.php +++ b/maintenance/clear_interwiki_cache.php @@ -1,4 +1,12 @@ +?> \ No newline at end of file diff --git a/maintenance/clear_pcache_stats.php b/maintenance/clear_pcache_stats.php index 6d5e1f3e10..9cb25f50f6 100644 --- a/maintenance/clear_pcache_stats.php +++ b/maintenance/clear_pcache_stats.php @@ -1,4 +1,10 @@ delete($key); } -?> +?> \ No newline at end of file diff --git a/maintenance/compressOld.inc b/maintenance/compressOld.inc index 28ee16125a..bb4aa6efd9 100644 --- a/maintenance/compressOld.inc +++ b/maintenance/compressOld.inc @@ -4,9 +4,10 @@ * @subpackage Maintenance */ +/** */ require_once( '../includes/Revision.php' ); -/** */ +/** @todo document */ function compressOldPages( $start = 0 ) { $fname = 'compressOldPages'; @@ -33,6 +34,7 @@ function compressOldPages( $start = 0 ) { } while( true ); } +/** @todo document */ function compressPage( $row ) { $fname = 'compressPage'; if( false !== strpos( $row->old_flags, "gzip" ) ) { @@ -56,6 +58,7 @@ function compressPage( $row ) { define( 'LS_INDIVIDUAL', 0 ); define( 'LS_CHUNKED', 1 ); +/** @todo document */ function compressWithConcat( $startId, $maxChunkSize, $maxChunkFactor, $factorThreshold, $beginDate, $endDate ) { $fname = 'compressWithConcat'; @@ -205,5 +208,4 @@ function compressWithConcat( $startId, $maxChunkSize, $maxChunkFactor, $factorTh } return true; } - -?> +?> \ No newline at end of file diff --git a/maintenance/convertUtf8.php b/maintenance/convertUtf8.php index 4af3e860fc..d8ed9dea0f 100644 --- a/maintenance/convertUtf8.php +++ b/maintenance/convertUtf8.php @@ -6,23 +6,28 @@ 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. @@ -34,6 +39,10 @@ class UtfUpdater { } } + /** + * Truncate a table. + * @param string $table The table name to be truncated + */ function clearTable( $table ) { print "Clearing $table...\n"; $tableName = $this->db->tableName( $table ); @@ -97,6 +106,10 @@ class UtfUpdater { $this->db->freeResult( $res ); } + /** + * Lock tables. + * @param array $tables An array of table to be locked. + */ function lockTables( $tables ) { $query = ''; foreach( $tables as $table ) { @@ -106,7 +119,10 @@ class UtfUpdater { } $this->db->query( 'LOCK TABLES ' . $query ); } - + + /** + * @todo document + */ function updateAll() { $this->lockTables( array( 'linkscc', 'objectcache', 'searchindex', 'querycache', @@ -155,5 +171,4 @@ class UtfUpdater { } } - -?> +?> \ No newline at end of file diff --git a/maintenance/dumpReplayLog.php b/maintenance/dumpReplayLog.php index b4481674cf..b87770a9da 100644 --- a/maintenance/dumpReplayLog.php +++ b/maintenance/dumpReplayLog.php @@ -1,10 +1,15 @@ tableName( 'recentchanges' ); @@ -22,6 +27,7 @@ function dumpReplayLog( $start ) { $dbw->freeResult( $result ); } +/** */ function dumpReplayEntry( $row ) { $title = Title::MakeTitle( $row->rc_namespace, $row->rc_title ); switch( $row->rc_type ) { diff --git a/maintenance/dumpRev.php b/maintenance/dumpRev.php index e42b90ad67..fd6c31f93a 100644 --- a/maintenance/dumpRev.php +++ b/maintenance/dumpRev.php @@ -1,8 +1,14 @@ -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 diff --git a/maintenance/parserTests.php b/maintenance/parserTests.php index d7b94687d0..d493dd60bc 100644 --- a/maintenance/parserTests.php +++ b/maintenance/parserTests.php @@ -32,7 +32,10 @@ require_once( 'commandLine.inc' ); 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 @@ -658,4 +661,4 @@ $ok = $tester->runTestsFromFile( 'maintenance/parserTests.txt' ); exit ($ok ? 0 : -1); -?> +?> \ No newline at end of file diff --git a/maintenance/pcache_stats.php b/maintenance/pcache_stats.php index 0f7c454db1..19497b125a 100644 --- a/maintenance/pcache_stats.php +++ b/maintenance/pcache_stats.php @@ -1,4 +1,10 @@ get("$wgDBname:stats:pcache_hit")); @@ -11,4 +17,4 @@ printf( "invalid: %-10d %6.2f%%\n", $invalid, $invalid/$total*100 ); 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 diff --git a/maintenance/portal.php b/maintenance/portal.php index f99820a2ec..c3093c6004 100644 --- a/maintenance/portal.php +++ b/maintenance/portal.php @@ -1,5 +1,9 @@ -