fix phpdoc comment
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 27 Jan 2005 23:25:16 +0000 (23:25 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 27 Jan 2005 23:25:16 +0000 (23:25 +0000)
maintenance/InitialiseMessages.inc
maintenance/benchmarkPurge.php
maintenance/clear_interwiki_cache.php
maintenance/clear_pcache_stats.php
maintenance/compressOld.inc
maintenance/convertUtf8.php
maintenance/dumpReplayLog.php
maintenance/dumpRev.php
maintenance/parserTests.php
maintenance/pcache_stats.php
maintenance/portal.php

index 9815770..cb821c0 100755 (executable)
@@ -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
index 19cd88c..9f45433 100644 (file)
@@ -1,9 +1,14 @@
 <?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++) {
@@ -16,6 +21,7 @@ function benchSquid( $urls, $trials = 1 ) {
                count( $urls ), $pertrial * 1000.0, $pertitle * 1000.0 );
 }
 
+/** @todo document */
 function randomUrlList( $length ) {
        $list = array();
        for( $i = 0; $i < $length; $i++ ) {
@@ -24,11 +30,13 @@ function randomUrlList( $length ) {
        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 );
@@ -54,5 +62,4 @@ if( !$wgUseSquid ) {
                print "$trial\n";
        }
 }
-
-?>
+?>
\ No newline at end of file
index a16ba87..ca26d73 100644 (file)
@@ -1,4 +1,12 @@
 <?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 ) {
@@ -8,4 +16,4 @@ foreach ( $wgLocalDatabases as $db ) {
        }
 }
 print "\n";
-?>
+?>
\ No newline at end of file
index 6d5e1f3..9cb25f5 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
 require_once('commandLine.inc');
 
 foreach ( $wgLocalDatabases as $db ) {
@@ -8,6 +14,7 @@ foreach ( $wgLocalDatabases as $db ) {
        noisyDelete("$db:stats:pcache_miss_absent");
 }
 
+/** @todo document */
 function noisyDelete( $key ) {
        global $wgMemc;
        /*
@@ -19,4 +26,4 @@ function noisyDelete( $key ) {
        }*/
        $wgMemc->delete($key);
 }
-?>
+?>
\ No newline at end of file
index 28ee161..bb4aa6e 100644 (file)
@@ -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
index 4af3e86..d8ed9de 100644 (file)
@@ -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
index b448167..b87770a 100644 (file)
@@ -1,10 +1,15 @@
 <?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' );
@@ -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 ) {
index e42b90a..fd6c31f 100644 (file)
@@ -1,8 +1,14 @@
-<?
+<?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
index d7b9468..d493dd6 100644 (file)
@@ -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
index 0f7c454..19497b1 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
 require_once('commandLine.inc');
 
 $hits = intval($wgMemc->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
index f99820a..c3093c6 100644 (file)
@@ -1,5 +1,9 @@
-<?
-
+<?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" ;
@@ -9,7 +13,7 @@ $perrow = 3 ;
 
 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"] ) )
@@ -18,7 +22,9 @@ 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");
@@ -29,7 +35,7 @@ function readafile ( $filename )
        return $contents ;
        }
 
-# Parsing statistics file
+/** Parsing statistics file */
 function get_numbers ( $filename )
        {
        $r = array () ;
@@ -44,7 +50,7 @@ function get_numbers ( $filename )
        return $r ;
        }
        
-# Make shades for pref. language(s)
+/** Make shades for pref. language(s) */
 function getshades ( $l )
        {
        $r = array () ;
@@ -78,7 +84,7 @@ $t = readafile ( $textsourcefile ) ;
 $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