Changing comments layout preparing for generated documentation with Phpdocumentor
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 2 Sep 2004 23:28:24 +0000 (23:28 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 2 Sep 2004 23:28:24 +0000 (23:28 +0000)
116 files changed:
includes/Article.php
includes/Block.php
includes/BlockCache.php
includes/CacheManager.php
includes/CategoryPage.php
includes/Credits.php
includes/Database.php
includes/DatabaseFunctions.php
includes/DatabasePostgreSQL.php
includes/DateFormatter.php
includes/DefaultSettings.php
includes/Defines.php
includes/DifferenceEngine.php
includes/EditPage.php
includes/Feed.php
includes/FulltextStoplist.php
includes/GlobalFunctions.php
includes/HistoryBlob.php
includes/Image.php
includes/ImagePage.php
includes/Interwiki.php
includes/LinkCache.php
includes/LinksUpdate.php
includes/LoadBalancer.php
includes/LogPage.php
includes/MagicWord.php
includes/Math.php
includes/MemcachedSessions.php
includes/MessageCache.php
includes/Metadata.php
includes/Namespace.php
includes/ObjectCache.php
includes/OutputPage.php
includes/PageHistory.php
includes/Parser.php
includes/ParserCache.php
includes/ParserXML.php
includes/Profiling.php
includes/QueryPage.php
includes/RawPage.php
includes/RecentChange.php
includes/SearchEngine.php
includes/SearchUpdate.php
includes/Setup.php
includes/SiteConfiguration.php
includes/SiteStatsUpdate.php
includes/Skin.php
includes/SkinPHPTal.php
includes/SpecialAllmessages.php
includes/SpecialAllpages.php
includes/SpecialAncientpages.php
includes/SpecialAsksql.php
includes/SpecialBlockip.php
includes/SpecialBlockme.php
includes/SpecialBooksources.php
includes/SpecialBrokenRedirects.php
includes/SpecialCategories.php
includes/SpecialContributions.php
includes/SpecialDeadendpages.php
includes/SpecialDebug.php
includes/SpecialDisambiguations.php
includes/SpecialDoubleRedirects.php
includes/SpecialEmailuser.php
includes/SpecialExport.php
includes/SpecialGeo.php
includes/SpecialImagelist.php
includes/SpecialImport.php
includes/SpecialIpblocklist.php
includes/SpecialListadmins.php
includes/SpecialListusers.php
includes/SpecialLockdb.php
includes/SpecialLog.php
includes/SpecialLonelypages.php
includes/SpecialLongpages.php
includes/SpecialMaintenance.php
includes/SpecialMakesysop.php
includes/SpecialMovepage.php
includes/SpecialNeglectedpages.php
includes/SpecialNewpages.php
includes/SpecialPage.php
includes/SpecialPopularpages.php
includes/SpecialPreferences.php
includes/SpecialRandompage.php
includes/SpecialRecentchanges.php
includes/SpecialRecentchangeslinked.php
includes/SpecialSearch.php
includes/SpecialShortpages.php
includes/SpecialSpecialpages.php
includes/SpecialStatistics.php
includes/SpecialUncategorizedpages.php
includes/SpecialUndelete.php
includes/SpecialUnlockdb.php
includes/SpecialUnusedimages.php
includes/SpecialUpload.php
includes/SpecialUserlogin.php
includes/SpecialUserlogout.php
includes/SpecialValidate.php
includes/SpecialVersion.php
includes/SpecialVote.php
includes/SpecialWantedpages.php
includes/SpecialWatchlist.php
includes/SpecialWhatlinkshere.php
includes/SquidUpdate.php
includes/Title.php
includes/Tokenizer.php
includes/UpdateClasses.php
includes/User.php
includes/UserMailer.php
includes/UserTalkUpdate.php
includes/UserUpdate.php
includes/Utf8Case.php
includes/ViewCountUpdate.php
includes/WatchedItem.php
includes/WebRequest.php
includes/killthread.php
includes/proxy_check.php

index f12a5f2..0c71859 100644 (file)
@@ -1,32 +1,50 @@
 <?php
 # $Id$
-#
-# Class representing a Wikipedia article and history.
-# See design.doc for an overview.
-
-# Note: edit user interface and cache support functions have been
-# moved to separate EditPage and CacheManager classes.
+/**
+ * File for articles
+ */
 
+/**
+ * Need the CacheManager to be loaded
+ */
 require_once ( 'CacheManager.php' );
 
 $wgArticleCurContentFields = false;
 $wgArticleOldContentFields = false;
 
+/**
+ * Class representing a Wikipedia article and history.
+ *
+ * See design.doc for an overview.
+ * Note: edit user interface and cache support functions have been
+ * moved to separate EditPage and CacheManager classes.
+ */
 class Article {
-       /* private */ var $mContent, $mContentLoaded;
-       /* private */ var $mUser, $mTimestamp, $mUserText;
-       /* private */ var $mCounter, $mComment, $mCountAdjustment;
-       /* private */ var $mMinorEdit, $mRedirectedFrom;
-       /* private */ var $mTouched, $mFileCache, $mTitle;
-       /* private */ var $mId, $mTable;
-       /* private */ var $mForUpdate;
-
+       /**#@+
+        * @access private
+        */
+       var $mContent, $mContentLoaded;
+       var $mUser, $mTimestamp, $mUserText;
+       var $mCounter, $mComment, $mCountAdjustment;
+       var $mMinorEdit, $mRedirectedFrom;
+       var $mTouched, $mFileCache, $mTitle;
+       var $mId, $mTable;
+       var $mForUpdate;
+       /**#@-*/
+
+       /**
+        * Constructor and clear the article
+        */
        function Article( &$title ) {
                $this->mTitle =& $title;
                $this->clear();
        }
 
-       /* private */ function clear() {
+       /**
+         * Clear the object
+         * @private
+         */
+       function clear() {
                $this->mContentLoaded = false;
                $this->mCurID = $this->mUser = $this->mCounter = -1; # Not loaded
                $this->mRedirectedFrom = $this->mUserText =
@@ -36,9 +54,16 @@ class Article {
                $this->mForUpdate = false;
        }
 
-       # Get revision text associated with an old or archive row
-       # $row is usually an object from wfFetchRow(), both the flags and the text field must be included
-       /* static */ function getRevisionText( $row, $prefix = 'old_' ) {
+       /**
+         * Get revision text associated with an old or archive row
+         * $row is usually an object from wfFetchRow(), both the flags and the text
+         * field must be included
+         * @static
+         * @param integer $row Id of a row
+         * @param string $prefix table prefix (default 'old_')
+         * @return string $text the text requested
+       */
+       function getRevisionText( $row, $prefix = 'old_' ) {
                # Get data
                $textField = $prefix . 'text';
                $flagsField = $prefix . 'flags';
@@ -67,7 +92,13 @@ class Article {
                return $text;
        }
 
-       /* static */ function compressRevisionText( &$text ) {
+       /**
+        * If $wgCompressRevisions is enabled, we will compress datas
+        * @static
+        * @param reference to a text
+        * @return string 'gzip' if it get compressed, '' overwise
+        */
+       function compressRevisionText( &$text ) {
                global $wgCompressRevisions;
                if( !$wgCompressRevisions ) {
                        return '';
@@ -80,8 +111,11 @@ class Article {
                return 'gzip';
        }
 
-       # Returns the text associated with a "link" type old table row
-       /* static */ function followLink( $link ) {
+       /**
+        * Returns the text associated with a "link" type old table row
+        * @static
+        */
+       function followLink( $link ) {
                # Split the link into fields and values
                $lines = explode( '\n', $link );
                $hash = '';
@@ -119,7 +153,10 @@ class Article {
                return $text;
        }
 
-       /* static */ function fetchFromLocation( $location, $hash ) {
+       /**
+        * @static
+        */
+       function fetchFromLocation( $location, $hash ) {
                global $wgLoadBalancer;
                $fname = 'fetchFromLocation';
                wfProfileIn( $fname );
@@ -195,10 +232,12 @@ class Article {
                return $text;
        }
 
-       # Note that getContent/loadContent may follow redirects if
-       # not told otherwise, and so may cause a change to mTitle.
-
-       # Return the text of this revision
+       /**
+        * Note that getContent/loadContent may follow redirects if
+        * not told otherwise, and so may cause a change to mTitle.
+        *
+        * Return the text of this revision
+       */
        function getContent( $noredir ) {
                global $wgRequest;
 
@@ -246,12 +285,13 @@ class Article {
                }
        }
 
-       # This function returns the text of a section, specified by a number ($section).
-       # A section is text under a heading like == Heading == or <h1>Heading</h1>, or
-       # the first section before any such heading (section 0).
-       #
-       # If a section contains subsections, these are also returned.
-       #
+       /**
+        * This function returns the text of a section, specified by a number ($section).
+        * A section is text under a heading like == Heading == or <h1>Heading</h1>, or
+        * the first section before any such heading (section 0).
+        *
+        * If a section contains subsections, these are also returned.
+       */
        function getSection($text,$section) {
 
                # strip NOWIKI etc. to avoid confusion (true-parameter causes HTML
@@ -310,7 +350,9 @@ class Article {
 
        }
 
-       # Return an array of the columns of the "cur"-table
+       /**
+        * Return an array of the columns of the "cur"-table
+       */
        function &getCurContentFields() {
                global $wgArticleCurContentFields;
                if ( !$wgArticleCurContentFields ) {
@@ -320,7 +362,9 @@ class Article {
                return $wgArticleCurContentFields;
        }
 
-       # Return an array of the columns of the "old"-table
+       /**
+        * Return an array of the columns of the "old"-table
+       */
        function &getOldContentFields() {
                global $wgArticleOldContentFields;
                if ( !$wgArticleOldContentFields ) {
@@ -330,7 +374,9 @@ class Article {
                return $wgArticleOldContentFields;
        }
 
-       # Load the revision (including cur_text) into this object
+       /**
+        * Load the revision (including cur_text) into this object
+       */
        function loadContent( $noredir = false ) {
                global $wgOut, $wgMwRedir, $wgRequest;
 
@@ -431,8 +477,10 @@ class Article {
                return $this->mContent;
        }
 
-       # Gets the article text without using so many damn globals
-       # Returns false on error
+       /**
+        * Gets the article text without using so many damn globals
+        * Returns false on error
+       */
        function getContentWithoutUsingSoManyDamnGlobals( $oldid = 0, $noredir = false ) {
                global $wgMwRedir;
 
@@ -501,12 +549,16 @@ class Article {
                return $this->mContent;
        }
 
-       # Read/write accessor to select FOR UPDATE
+       /**
+        * Read/write accessor to select FOR UPDATE
+        */
        function forUpdate( $x = NULL ) {
                return wfSetVar( $this->mForUpdate, $x );
        }
 
-       # Get the database which should be used for reads
+       /**
+        * Get the database which should be used for reads
+        */
        function &getDB() {
                if ( $this->mForUpdate ) {
                        return wfGetDB( DB_MASTER );
@@ -515,8 +567,10 @@ class Article {
                }
        }
 
-       # Get options for all SELECT statements
-       # Can pass an option array, to which the class-wide options will be appended
+       /**
+        * Get options for all SELECT statements
+        * Can pass an option array, to which the class-wide options will be appended
+        */
        function getSelectOptions( $options = '' ) {
                if ( $this->mForUpdate ) {
                        if ( $options ) {
@@ -528,6 +582,9 @@ class Article {
                return $options;
        }
 
+       /**
+        * Return the Article ID
+        */
        function getID() {
                if( $this->mTitle ) {
                        return $this->mTitle->getArticleID();
@@ -536,6 +593,9 @@ class Article {
                }
        }
 
+       /*
+        * @todo document function
+        */
        function getCount() {
                if ( -1 == $this->mCounter ) {
                        $id = $this->getID();
@@ -546,8 +606,10 @@ class Article {
                return $this->mCounter;
        }
 
-       # Would the given text make this article a "good" article (i.e.,
-       # suitable for including in the article count)?
+       /**
+        * Would the given text make this article a "good" article (i.e.,
+        * suitable for including in the article count)?
+        */
        function isCountable( $text ) {
                global $wgUseCommaCount, $wgMwRedir;
 
@@ -558,9 +620,12 @@ class Article {
                return 1;
        }
 
-       # Loads everything from cur except cur_text
-       # This isn't necessary for all uses, so it's only done if needed.
-       /* private */ function loadLastEdit() {
+       /**
+        * Loads everything from cur except cur_text
+        * This isn't necessary for all uses, so it's only done if needed.
+        * @private
+        */
+       function loadLastEdit() {
                global $wgOut;
                if ( -1 != $this->mUser ) return;
 
@@ -640,9 +705,10 @@ class Article {
                return $contribs;
        }
 
-       # This is the default action of the script: just view the page of
-       # the given title.
-
+       /**
+        * This is the default action of the script: just view the page of
+        * the given title.
+       */
        function view() {
                global $wgUser, $wgOut, $wgLang, $wgRequest, $wgMwRedir, $wgOnlySysopsCanPatrol;
                global $wgLinkCache, $IP, $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol;
@@ -769,12 +835,14 @@ class Article {
                wfProfileOut( $fname );
        }
 
-       # Theoretically we could defer these whole insert and update
-       # functions for after display, but that's taking a big leap
-       # of faith, and we want to be able to report database
-       # errors at some point.
-
-       /* private */ function insertNewArticle( $text, $summary, $isminor, $watchthis ) {
+       /**
+        * Theoretically we could defer these whole insert and update
+        * functions for after display, but that's taking a big leap
+        * of faith, and we want to be able to report database
+        * errors at some point.
+        * @private
+        */
+       function insertNewArticle( $text, $summary, $isminor, $watchthis ) {
                global $wgOut, $wgUser, $wgMwRedir;
                global $wgUseSquid, $wgDeferredUpdateList, $wgInternalServer;
 
@@ -843,7 +911,9 @@ class Article {
        }
 
 
-       /* Side effects: loads last edit */
+       /**
+        * Side effects: loads last edit
+        */
        function getTextOfLastEditWithSectionReplacedOrAdded($section, $text, $summary = '') {
                $this->loadLastEdit();
                $oldtext = $this->getContent( true );
@@ -919,6 +989,9 @@ class Article {
                return $text;
        }
 
+       /**
+        * @todo document this function
+        */
        function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
                global $wgOut, $wgUser;
                global $wgDBtransactions, $wgMwRedir;
@@ -1053,9 +1126,10 @@ class Article {
                return $good;
        }
 
-       # After we've either updated or inserted the article, update
-       # the link tables and redirect to the new page.
-
+       /**
+        * After we've either updated or inserted the article, update
+        * the link tables and redirect to the new page.
+        */
        function showArticle( $text, $subtitle , $sectionanchor = '' ) {
                global $wgOut, $wgUser, $wgLinkCache;
                global $wgMwRedir;
@@ -1082,8 +1156,10 @@ class Article {
                $wgOut->redirect( $this->mTitle->getFullURL( $r ).$sectionanchor );
        }
 
-       # Validate article
-
+       /**
+        * Validate article
+        * @todo document this function a bit more
+        */
        function validate () {
                global $wgOut, $wgUseValidation;
                if( $wgUseValidation ) {
@@ -1101,7 +1177,9 @@ class Article {
                }
        }
 
-       # Mark this particular edit as patrolled
+       /**
+        * Mark this particular edit as patrolled
+        */
        function markpatrolled() {
                global $wgOut, $wgRequest, $wgOnlySysopsCanPatrol, $wgUseRCPatrol, $wgUser;
                $wgOut->setRobotpolicy( 'noindex,follow' );
@@ -1136,8 +1214,9 @@ class Article {
        }
 
 
-       # Add this page to my watchlist
-
+       /**
+        * Add or remove this page to my watchlist based on value of $add
+        */
        function watch( $add = true ) {
                global $wgUser, $wgOut, $wgLang;
                global $wgDeferredUpdateList;
@@ -1173,12 +1252,16 @@ class Article {
                $wgOut->returnToMain( true, $this->mTitle->getPrefixedText() );
        }
 
+       /**
+        * Stop watching a page, it act just like a call to watch(false)
+        */
        function unwatch() {
                $this->watch( false );
        }
 
-       # protect a page
-
+       /**
+        * protect a page
+        */
        function protect( $limit = 'sysop' ) {
                global $wgUser, $wgOut, $wgRequest;
 
@@ -1224,8 +1307,9 @@ class Article {
                }
        }
 
-       # Output protection confirmation dialog
-
+       /**
+        * Output protection confirmation dialog
+        */
        function confirmProtect( $par, $reason, $limit = 'sysop'  ) {
                global $wgOut;
 
@@ -1289,12 +1373,16 @@ class Article {
                $wgOut->returnToMain( false );
        }
 
+       /**
+        * Unprotect the pages
+        */
        function unprotect() {
                return $this->protect( '' );
        }
 
-       # UI entry point for page deletion
-
+       /*
+        * UI entry point for page deletion
+        */
        function delete() {
                global $wgUser, $wgOut, $wgMessageCache, $wgRequest;
                $fname = 'Article::delete';
@@ -1401,8 +1489,9 @@ class Article {
                return $this->confirmDelete( '', $reason );
        }
 
-       # Output deletion confirmation dialog
-
+       /**
+        * Output deletion confirmation dialog
+        */
        function confirmDelete( $par, $reason ) {
                global $wgOut;
 
@@ -1454,8 +1543,9 @@ class Article {
        }
 
 
-       # Perform a deletion and output success or failure messages
-
+       /**
+        * Perform a deletion and output success or failure messages
+        */
        function doDelete( $reason ) {
                global $wgOut, $wgUser, $wgLang;
                $fname = 'Article::doDelete';
@@ -1480,9 +1570,11 @@ class Article {
                }
        }
 
-       # Back-end article deletion
-       # Deletes the article with database consistency, writes logs, purges caches
-       # Returns success
+       /**
+        * Back-end article deletion
+        * Deletes the article with database consistency, writes logs, purges caches
+        * Returns success
+        */
        function doDeleteArticle( $reason ) {
                global $wgUser, $wgLang;
                global  $wgUseSquid, $wgDeferredUpdateList, $wgInternalServer;
@@ -1601,6 +1693,9 @@ class Article {
                return true;
        }
 
+       /**
+        * Revert a modification
+        */
        function rollback() {
                global $wgUser, $wgLang, $wgOut, $wgRequest;
                $fname = 'Article::rollback';
@@ -1691,9 +1786,11 @@ class Article {
        }
 
 
-       # Do standard deferred updates after page view
-
-       /* private */ function viewUpdates() {
+       /**
+        * Do standard deferred updates after page view
+        * @private
+        */
+       function viewUpdates() {
                global $wgDeferredUpdateList;
                if ( 0 != $this->getID() ) {
                        global $wgDisableCounters;
@@ -1708,10 +1805,12 @@ class Article {
                array_push( $wgDeferredUpdateList, $u );
        }
 
-       # Do standard deferred updates after page edit.
-       # Every 1000th edit, prune the recent changes table.
-
-       /* private */ function editUpdates( $text ) {
+       /**
+        * Do standard deferred updates after page edit.
+        * Every 1000th edit, prune the recent changes table.
+        * @private
+        */
+       function editUpdates( $text ) {
                global $wgDeferredUpdateList, $wgDBname, $wgMemc;
                global $wgMessageCache;
 
@@ -1745,7 +1844,11 @@ class Article {
                }
        }
 
-       /* private */ function setOldSubtitle() {
+       /**
+        * @todo document this function
+        * @private
+        */
+       function setOldSubtitle() {
                global $wgLang, $wgOut, $wgUser;
 
                $td = $wgLang->timeanddate( $this->mTimestamp, true );
@@ -1755,9 +1858,10 @@ class Article {
                $wgOut->setSubtitle( $r );
        }
 
-       # This function is called right before saving the wikitext,
-       # so we can do things like signatures and links-in-context.
-
+       /**
+        * This function is called right before saving the wikitext,
+        * so we can do things like signatures and links-in-context.
+        */
        function preSaveTransform( $text ) {
                global $wgParser, $wgUser;
                return $wgParser->preSaveTransform( $text, $this->mTitle, $wgUser, ParserOptions::newFromUser( $wgUser ) );
@@ -1939,14 +2043,18 @@ class Article {
                $dbw->ignoreErrors( $oldignore );
        }
 
-       # The onArticle*() functions are supposed to be a kind of hooks
-       # which should be called whenever any of the specified actions
-       # are done.
-       #
-       # This is a good place to put code to clear caches, for instance.
-
-       # This is called on page move and undelete, as well as edit
-       /* static */ function onArticleCreate($title_obj) {
+       /**
+        * The onArticle*() functions are supposed to be a kind of hooks
+        * which should be called whenever any of the specified actions
+        * are done.
+        * 
+        * This is a good place to put code to clear caches, for instance.
+        * 
+        * This is called on page move and undelete, as well as edit
+        * @static
+        * @param $title_obj a title object
+        */
+       function onArticleCreate($title_obj) {
                global $wgUseSquid, $wgDeferredUpdateList;
 
                $titles = $title_obj->getBrokenLinksTo();
@@ -1965,17 +2073,24 @@ class Article {
                LinkCache::linksccClearBrokenLinksTo( $title_obj->getPrefixedDBkey() );
        }
 
-       /* static */ function onArticleDelete($title_obj) {
+       /**
+        * @static
+        */
+       function onArticleDelete($title_obj) {
                LinkCache::linksccClearLinksTo( $title_obj->getArticleID() );
        }
 
-       /* static */ function onArticleEdit($title_obj) {
+       /**
+        * @static
+        */
+       function onArticleEdit($title_obj) {
                LinkCache::linksccClearPage( $title_obj->getArticleID() );
        }
 
 
-       # Info about this page
-
+       /**
+        * Info about this page
+        */
        function info() {
                global $wgUser, $wgTitle, $wgOut, $wgLang, $wgAllowPageInfo;
                $fname = 'Article::info';
index 823fb5a..5cb81c4 100644 (file)
@@ -1,18 +1,23 @@
 <?php
-# Blocks and bans object
-#
-#TODO: This could be used everywhere, but it isn't.
-#
-# All the functions in this class assume the object is either explicitly 
-# loaded or filled. It is not load-on-demand. There are no accessors.
-#
-# To use delete(), you only need to fill $mAddress
-
-# Globals used: $wgBlockCache, $wgAutoblockExpiry
+/**
+ * Blocks and bans object
+ */
 
+/**
+ * Some globals
+ */
 define ( 'EB_KEEP_EXPIRED', 1 );
 define ( 'EB_FOR_UPDATE', 2 );
 
+/**
+ * The block class
+ * All the functions in this class assume the object is either explicitly 
+ * loaded or filled. It is not load-on-demand. There are no accessors.
+ * 
+ * To use delete(), you only need to fill $mAddress
+ * Globals used: $wgBlockCache, $wgAutoblockExpiry
+ * @todo This could be used everywhere, but it isn't.
+ */
 class Block
 {
        /* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry;
index 9f099b2..a4e97d5 100644 (file)
@@ -1,8 +1,12 @@
 <?php
+/**
+ * Contain the blockcache class
+ */
 
-# Object for fast lookup of IP blocks
-# Represents a memcached value, and in some sense, the entire ipblocks table
-
+/**
+ * Object for fast lookup of IP blocks
+ * Represents a memcached value, and in some sense, the entire ipblocks table
+ */
 class BlockCache
 {
        var $mData = false, $mMemcKey;
index 7a68114..b9d164f 100644 (file)
@@ -1,18 +1,25 @@
 <?php
+/**
+ * Contain the CacheManager class
+ */
 
-# Handles talking to the file cache, putting stuff in and taking it back out.
-# Mostly called from Article.php, also from DatabaseFunctions.php for the
-# emergency abort/fallback to cache.
-
-# Global options that affect this module:
-# $wgCachePages
-# $wgCacheEpoch
-# $wgUseFileCache
-# $wgFileCacheDirectory
-# $wgUseGzip
-
+/**
+ * We need the title class
+ */
 require_once( 'Title.php' );
 
+/**
+ * Handles talking to the file cache, putting stuff in and taking it back out.
+ * Mostly called from Article.php, also from DatabaseFunctions.php for the
+ * emergency abort/fallback to cache.
+ * 
+ * Global options that affect this module:
+ * $wgCachePages
+ * $wgCacheEpoch
+ * $wgUseFileCache
+ * $wgFileCacheDirectory
+ * $wgUseGzip
+ */
 class CacheManager {
        var $mTitle, $mFileCache;
        
index 3e630ce..84bf394 100644 (file)
@@ -1,15 +1,16 @@
 <?php
-
-/*
-       Special handling for category description pages
-       Modelled after ImagePage.php
+/**
+ * Special handling for category description pages
+ * Modelled after ImagePage.php
+ *
 */
 
+/**
+ *
+ */
 class CategoryPage extends Article {
 
-
        function view() {
-
                if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
                        $this->openShowCategory();
                }
@@ -25,8 +26,7 @@ class CategoryPage extends Article {
                }
        }
 
-       function openShowCategory()
-       {
+       function openShowCategory() {
                # For overloading
        }
        
@@ -36,8 +36,7 @@ class CategoryPage extends Article {
         # languages due to sorting issues, so they might want to turn it
         # off.
 
-       function closeShowCategory()
-       {
+       function closeShowCategory() {
                global $wgOut;
                $msg = wfMsg('usenewcategorypage');
                if ( '0' == @$msg[0] )
index 312d4f1..a92c9f9 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-/* Credits.php -- formats credits for articles
+/**
+ * Credits.php -- formats credits for articles
  * Copyright 2004, Evan Prodromou <evan@wikitravel.org>.
  * 
  *  This program is free software; you can redistribute it and/or modify
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * @author <evan@wikitravel.org>
  */
 
-/* This is largely cadged from PageHistory::history */
-
-function showCreditsPage($article)
-{
+/**
+ * This is largely cadged from PageHistory::history
+ */
+function showCreditsPage($article) {
     global $wgOut;
 
     $fname = 'showCreditsPage';
@@ -59,8 +62,10 @@ function getCredits($article, $cnt, $showIfMax=true) {
     return $s;
 }
 
-function getAuthorCredits($article) {
-    
+/**
+ *
+ */
+function getAuthorCredits($article) {    
     global $wgLang;
     
     $last_author = $article->getUser();
@@ -88,6 +93,9 @@ function getAuthorCredits($article) {
     return wfMsg('lastmodifiedby', $d, $author_credit);
 }
 
+/**
+ *
+ */
 function getContributorCredits($article, $cnt, $showIfMax) {
            
     global $wgLang, $wgAllowRealName;
@@ -156,6 +164,9 @@ function getContributorCredits($article, $cnt, $showIfMax) {
     return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
 }
 
+/**
+ *
+ */
 function creditLink($user_name, $link_text = '') {
     global $wgUser, $wgLang;
     $skin = $wgUser->getSkin();
@@ -163,6 +174,9 @@ function creditLink($user_name, $link_text = '') {
                           (empty($link_text)) ? $user_name : $link_text);
 }
 
+/**
+ *
+ */
 function creditOthersLink($article) {
     global $wgUser, $wgLang;
     $skin = $wgUser->getSkin();
index 49b9039..5d0951c 100644 (file)
@@ -1,8 +1,13 @@
 <?php
 # $Id$
-# This file deals with MySQL interface functions 
-# and query specifics/optimisations
-#
+/**
+ * This file deals with MySQL interface functions 
+ * and query specifics/optimisations
+ */
+
+/**
+ * Depends on the CacheManager
+ */
 require_once( 'CacheManager.php' );
 
 define( 'LIST_COMMA', 0 );
@@ -16,6 +21,10 @@ define( 'DEADLOCK_DELAY_MIN', 500000 );
 # Maximum time to wait before retry
 define( 'DEADLOCK_DELAY_MAX', 1500000 );
 
+/**
+ * Database abstraction object
+ * @category database
+ */
 class Database {
 
 #------------------------------------------------------------------------------
@@ -959,14 +968,19 @@ class Database {
        }
 } 
 
+/**
+ * Database abstraction object for mySQL
+ * @category database
+ */
 class DatabaseMysql extends Database {
        # Inherit all
 }
 
-#------------------------------------------------------------------------------
-# Result wrapper for grabbing data queried by someone else
-#------------------------------------------------------------------------------
 
+/**
+ * Result wrapper for grabbing data queried by someone else
+ * @category database
+ */
 class ResultWrapper {
        var $db, $result;
        
@@ -998,8 +1012,11 @@ class ResultWrapper {
 # Global functions
 #------------------------------------------------------------------------------
 
-/* Standard fail function, called by default when a connection cannot be established
-   Displays the file cache if possible */
+/**
+ * Standard fail function, called by default when a connection cannot be
+ * established.
+ * Displays the file cache if possible
+ */
 function wfEmergencyAbort( &$conn, $error ) {
        global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgSiteNotice, $wgOutputEncoding;
        
index 8bd5b6a..f87ac9a 100644 (file)
@@ -1,12 +1,16 @@
 <?php
 # $Id$
 
-# Backwards compatibility wrapper for Database.php
+/**
+ * Backwards compatibility wrapper for Database.php
+ * 
+ * Note: $wgDatabase has ceased to exist. Destroy all references.
+ */
 
-# Note: $wgDatabase has ceased to exist. Destroy all references.
-
-# Usually aborts on failure
-# If errors are explicitly ignored, returns success
+/**
+ * Usually aborts on failure
+ * If errors are explicitly ignored, returns success
+ */
 function wfQuery( $sql, $db, $fname = '' )
 {
        global $wgOut;
index b7665f4..21420a3 100644 (file)
@@ -1,21 +1,30 @@
 <?php
 # $Id$
-#
-# DO NOT USE !!!  Unless you want to help developping it.
-#
-# This file is an attempt to port the mysql database layer to postgreSQL. The
-# only thing done so far is s/mysql/pg/ and dieing if function haven't been
-# ported.
-# 
-# As said brion 07/06/2004 :
-# "table definitions need to be changed. fulltext index needs to work differently
-#  things that use the last insert id need to be changed. Probably other things
-#  need to be changed. various semantics may be different."
-#
-# Hashar
 
+/**
+ * DO NOT USE !!!  Unless you want to help developping it.
+ *
+ * This file is an attempt to port the mysql database layer to postgreSQL. The
+ * only thing done so far is s/mysql/pg/ and dieing if function haven't been
+ * ported.
+ *
+ * As said brion 07/06/2004 :
+ * "table definitions need to be changed. fulltext index needs to work differently
+ * things that use the last insert id need to be changed. Probably other things
+ * need to be changed. various semantics may be different."
+ *
+ * Hashar
+ *
+ */
+
+/**
+ * Depends on database
+ */
 require_once( 'Database.php' );
 
+/**
+ *
+ */
 class DatabasePgsql extends Database {
        var $mInsertId = NULL;
        var $mLastResult = NULL;
@@ -32,10 +41,11 @@ class DatabasePgsql extends Database {
                return new DatabasePgsql( $server, $user, $password, $dbName, $failFunction, $flags, $tablePrefix );
        }
 
-       # Usually aborts on failure
-       # If the failFunction is set to a non-zero integer, returns success
-       function open( $server, $user, $password, $dbName )
-       {
+       /**
+        * Usually aborts on failure
+        * If the failFunction is set to a non-zero integer, returns success
+        */
+       function open( $server, $user, $password, $dbName ) {
                # Test for PostgreSQL support, to avoid suppressed fatal error
                if ( !function_exists( 'pg_connect' ) ) {
                        die( "PostgreSQL functions missing, have you compiled PHP with the --with-pgsql option?\n" );
@@ -63,10 +73,11 @@ class DatabasePgsql extends Database {
                return $this->mConn;
        }
        
-       # Closes a database connection, if it is open
-       # Returns success, true if already closed
-       function close()
-       {
+       /**
+        * Closes a database connection, if it is open
+        * Returns success, true if already closed
+        */
+       function close() {
                $this->mOpened = false;
                if ( $this->mConn ) {
                        return pg_close( $this->mConn );
@@ -88,6 +99,7 @@ class DatabasePgsql extends Database {
                        wfDebugDieBacktrace( "Unable to free PostgreSQL result\n" );
                }
        }
+       
        function fetchObject( $res ) {
                @$row = pg_fetch_object( $res );
                # FIXME: HACK HACK HACK HACK debug
@@ -119,7 +131,9 @@ class DatabasePgsql extends Database {
        function numFields( $res ) { return pg_num_fields( $res ); }
        function fieldName( $res, $n ) { return pg_field_name( $res, $n ); }
        
-       # This must be called after nextSequenceVal
+       /**
+        * This must be called after nextSequenceVal
+        */
        function insertId() { 
                return $this->mInsertId;
        }
@@ -132,10 +146,11 @@ class DatabasePgsql extends Database {
                return pg_affected_rows( $this->mLastResult ); 
        }
        
-       # Returns information about an index
-       # If errors are explicitly ignored, returns NULL on failure
-       function indexInfo( $table, $index, $fname = 'Database::indexExists' ) 
-       {
+       /**
+        * Returns information about an index
+        * If errors are explicitly ignored, returns NULL on failure
+        */
+       function indexInfo( $table, $index, $fname = 'Database::indexExists' ) {
                $sql = "SELECT indexname FROM pg_indexes WHERE tablename='$table'";
                $res = $this->query( $sql, $fname );
                if ( !$res ) {
@@ -150,8 +165,7 @@ class DatabasePgsql extends Database {
                return false;
        }
 
-       function fieldInfo( $table, $field )
-       {
+       function fieldInfo( $table, $field ) {
                wfDebugDieBacktrace( 'Database::fieldInfo() error : mysql_fetch_field() not implemented for postgre' );
                /*
                $res = $this->query( "SELECT * FROM '$table' LIMIT 1" );
@@ -223,15 +237,19 @@ class DatabasePgsql extends Database {
                return pg_escape_string( $s );
        }
 
-       # Return the next in a sequence, save the value for retrieval via insertId()
+       /**
+        * Return the next in a sequence, save the value for retrieval via insertId()
+        */
        function nextSequenceValue( $seqName ) {
                $value = $this->getField(''," nextval('" . $seqName . "')");
                $this->mInsertId = $value;
                return $value;
        }
 
-       # USE INDEX clause
-       # PostgreSQL doesn't have them and returns ""
+       /**
+        * USE INDEX clause
+        * PostgreSQL doesn't have them and returns ""
+        */
        function useIndexClause( $index ) {
                return '';
        }
@@ -343,7 +361,9 @@ class DatabasePgsql extends Database {
        }
 }
 
-# Just an alias.
+/**
+ * Just an alias.
+ */
 class DatabasePostgreSQL extends DatabasePgsql {
 }
 
index 2d3fdef..6a8abf9 100755 (executable)
@@ -1,4 +1,12 @@
 <?php
+/**
+ * Contain things
+ * @todo document
+ */
+
+/**
+ *
+ */
 define('DF_ALL', -1);
 define('DF_NONE', 0);
 define('DF_MDY', 1);
@@ -13,8 +21,9 @@ define('DF_DM', 7);
 define('DF_MD', 8);
 define('DF_LAST', 8);
 
-# To do: preferences, OutputPage
-
+/**
+ * @todo preferences, OutputPage
+ */
 class DateFormatter
 {
        var $mSource, $mTarget;
index b1c90fe..2b0a5dd 100644 (file)
@@ -1,14 +1,14 @@
 <?php
-
 # $Id$
 # DO NOT EDIT THIS FILE!
-# To customize your installation, edit "LocalSettings.php".
-# 
-# Note that since all these string interpolations are expanded
-# before LocalSettings is included, if you localize something
-# like $wgScriptPath, you must also localize everything that
-# depends on it.
-
+/**
+ * To customize your installation, edit "LocalSettings.php".
+ *
+ * Note that since all these string interpolations are expanded
+ * before LocalSettings is included, if you localize something
+ * like $wgScriptPath, you must also localize everything that
+ * depends on it.
+*/
 # This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
 if( defined( 'MEDIAWIKI' ) ) {
 
index e5f5fb7..6082366 100644 (file)
@@ -1,17 +1,31 @@
 <?php
-# A few constants that might be needed during LocalSettings.php
 
+/**
+ * A few constants that might be needed during LocalSettings.php
+ */
+
+/**#@+
+ * @global integer
+ */
 define( 'DBO_DEBUG', 1 );
 define( 'DBO_NOBUFFER', 2 );
 define( 'DBO_IGNORE', 4 );
 define( 'DBO_TRX', 8 );
 define( 'DBO_DEFAULT', 16 );
+/**#@- */
 
-# Virtual namespaces; these don't appear in the page database:
+/**#@+
+ * Virtual namespaces; these don't appear in the page database
+ * @global integer
+ */
 define('NS_MEDIA', -2);
 define('NS_SPECIAL', -1);
+/**#@- */
 
-# Real namespaces:
+/**#@+
+ * Real namespaces
+ * @global integer
+ */
 define('NS_MAIN', 0);
 define('NS_TALK', 1);
 define('NS_USER', 2);
@@ -28,11 +42,16 @@ define('NS_HELP', 12);
 define('NS_HELP_TALK', 13);
 define('NS_CATEGORY', 14);
 define('NS_CATEGORY_TALK', 15);
+/**#@- */
 
-# Fix the code and remove these...
+/**#@+
+ * Fix the code and remove these...
+ * @global integer
+ * @todo Globals that need to be removed after code cleaning
+ */
 define('NS_WP', NS_PROJECT);
 define('NS_WP_TALK', NS_PROJECT_TALK);
 define('NS_WIKIPEDIA', NS_PROJECT);
 define('NS_WIKIPEDIA_TALK', NS_PROJECT_TALK);
-
+/**#@- */
 ?>
index eee7c61..e478689 100644 (file)
@@ -1,6 +1,11 @@
 <?php
-# See diff.doc
+/**
+ * See diff.doc
+ */
 
+/**
+ * @todo document
+ */
 class DifferenceEngine {
        /* private */ var $mOldid, $mNewid;
        /* private */ var $mOldtitle, $mNewtitle, $mPagetitle;
@@ -321,6 +326,9 @@ class DifferenceEngine {
 
 define('USE_ASSERTS', function_exists('assert'));
 
+/**
+ * @todo document
+ */
 class _DiffOp {
        var $type;
        var $orig;
@@ -339,6 +347,9 @@ class _DiffOp {
        }
 }
 
+/**
+ * @todo document
+ */
 class _DiffOp_Copy extends _DiffOp {
        var $type = 'copy';
 
@@ -354,6 +365,9 @@ class _DiffOp_Copy extends _DiffOp {
        }
 }
 
+/**
+ * @todo document
+ */
 class _DiffOp_Delete extends _DiffOp {
        var $type = 'delete';
 
@@ -367,6 +381,9 @@ class _DiffOp_Delete extends _DiffOp {
        }
 }
 
+/**
+ * @todo document
+ */
 class _DiffOp_Add extends _DiffOp {
        var $type = 'add';
 
@@ -380,6 +397,9 @@ class _DiffOp_Add extends _DiffOp {
        }
 }
 
+/**
+ * @todo document
+ */
 class _DiffOp_Change extends _DiffOp {
        var $type = 'change';
 
@@ -797,6 +817,7 @@ class _DiffEngine
 
 /**
  * Class representing a 'diff' between two sequences of strings.
+ * @todo document
  */
 class Diff
 {
@@ -932,9 +953,9 @@ class Diff
 
 /**
  * FIXME: bad name.
+ * @todo document
  */
-class MappedDiff
-extends Diff
+class MappedDiff extends Diff
 {
        /**
         * Constructor.
@@ -990,6 +1011,7 @@ extends Diff
  * This class formats the diff in classic diff format.
  * It is intended that this class be customized via inheritance,
  * to obtain fancier outputs.
+ * @todo document
  */
 class DiffFormatter
 {
@@ -1145,6 +1167,9 @@ class DiffFormatter
 
 define('NBSP', '&#160;');                      // iso-8859-x non-breaking space.
 
+/**
+ * @todo document
+ */
 class _HWLDF_WordAccumulator {
        function _HWLDF_WordAccumulator () {
                $this->_lines = array();
@@ -1198,6 +1223,9 @@ class _HWLDF_WordAccumulator {
        }
 }
 
+/**
+ * @todo document
+ */
 class WordLevelDiff extends MappedDiff
 {
        function WordLevelDiff ($orig_lines, $closing_lines) {
@@ -1245,7 +1273,7 @@ class WordLevelDiff extends MappedDiff
 
 /**
  *     Wikipedia Table style diff formatter.
- *
+ * @todo document
  */
 class TableDiffFormatter extends DiffFormatter
 {
index 83f3034..02cba87 100644 (file)
@@ -1,11 +1,15 @@
 <?php
 # $Id$
-
-# Splitting edit page/HTML interface from Article...
-# The actual database and text munging is still in Article,
-# but it should get easier to call those from alternate
-# interfaces.
-
+/**
+ * Contain the EditPage class
+ */
+
+/**
+ * Splitting edit page/HTML interface from Article...
+ * The actual database and text munging is still in Article,
+ * but it should get easier to call those from alternate
+ * interfaces.
+ */
 class EditPage {
        var $mArticle;
        var $mTitle;
index b0d208b..a34dae4 100644 (file)
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
+/**
+ * Contain class to build rss / atom ... feeds
+ */
+
+/**
+ * Available feeds objects
+ */
 $wgFeedClasses = array(
        'rss' => 'RSSFeed',
        'atom' => 'AtomFeed',
        );
 
+/**
+ * @todo document
+ */
 class FeedItem {
        var $Title = 'Wiki';
        var $Description = '';
@@ -73,6 +83,9 @@ class FeedItem {
        }
 }
 
+/**
+ * @todo document
+ */
 class ChannelFeed extends FeedItem {
        /* Abstract functions, override! */
        function outHeader() {
@@ -99,6 +112,10 @@ class ChannelFeed extends FeedItem {
        }
 }
 
+/**
+ * Generate a RSS feed
+ * @todo document
+ */
 class RSSFeed extends ChannelFeed {
 
        function formatTime( $ts ) {
@@ -140,6 +157,10 @@ class RSSFeed extends ChannelFeed {
        }
 }
 
+/**
+ * Generate an Atom feed
+ * @todo document
+ */
 class AtomFeed extends ChannelFeed {
        function formatTime( $ts ) {
                // need to use RFC 822 time format at least for rss2.0
index 132fcb2..81feb36 100644 (file)
@@ -1,21 +1,30 @@
 <?php
+/**
+ * This is the MySQL fulltext search stoplist, copied from the
+ * source file "myisam/ft_static.c" in the MySQL source distribution.
+ * If you use a new version of MySQL, this might have to be changed.
+ *
+ * The list is used to strip out stopwords from search queries to avoid
+ * nulling out the combined search results when using MySQL 3.x.
+ */
 
-# This is the MySQL fulltext search stoplist, copied from the
-# source file "myisam/ft_static.c" in the MySQL source distribution.
-# If you use a new version of MySQL, this might have to be changed.
-#
-# The list is used to strip out stopwords from search queries to avoid
-# nulling out the combined search results when using MySQL 3.x.
-
+/**
+ * Words are separated by spaces (could be any character) so when doing search,
+ * we search for a word with a space appended at the end and in front of a word.
+ * @global string Provide a list of english words for MySQL 3.x
+ * @private
+ */
 global $wgFulltextStoplist;
-/* private */ $wgFulltextStoplist = " a a's able about above according accordingly across actually after afterwards again against ain't all allow allows almost alone along already also although always am among amongst an and another any anybody anyhow anyone anything anyway anyways anywhere apart appear appreciate appropriate are aren't around as aside ask asking associated at available away awfully b be became because become becomes becoming been before beforehand behind being believe below beside besides best better between beyond both brief but by c c'mon c's came can can't cannot cant cause causes certain certainly changes clearly co com come comes concerning consequently consider considering contain containing contains corresponding could couldn't course currently d definitely described despite did didn't different do does doesn't doing don't done down downwards during e each edu eg eight either else elsewhere enough entirely especially et etc even ever every everybody everyone everything everywhere ex exactly example except f far few fifth first five followed following follows for former formerly forth four from further furthermore g get gets getting given gives go goes going gone got gotten greetings h had hadn't happens hardly has hasn't have haven't having he he's hello help hence her here here's hereafter hereby herein hereupon hers herself hi him himself his hither hopefully how howbeit however i i'd i'll i'm i've ie if ignored immediate in inasmuch inc indeed indicate indicated indicates inner insofar instead into inward is isn't it it'd it'll it's its itself j just k keep keeps kept know knows known l last lately later latter latterly least less lest let let's like liked likely little look looking looks ltd m mainly many may maybe me mean meanwhile merely might more moreover most mostly much must my myself n name namely nd near nearly necessary need needs neither never nevertheless new next nine no nobody non none noone nor normally not nothing novel now nowhere o obviously of off often oh ok okay old on once one ones only onto or other others otherwise ought our ours ourselves out outside over overall own p particular particularly per perhaps placed please plus possible presumably probably provides q que quite qv r rather rd re really reasonably regarding regardless regards relatively respectively right s said same saw say saying says second secondly see seeing seem seemed seeming seems seen self selves sensible sent serious seriously seven several shall she should shouldn't since six so some somebody somehow someone something sometime sometimes somewhat somewhere soon sorry specified specify specifying still sub such sup sure t t's take taken tell tends th than thank thanks thanx that that's thats the their theirs them themselves then thence there there's thereafter thereby therefore therein theres thereupon these they they'd they'll they're they've think third this thorough thoroughly those though three through throughout thru thus to together too took toward towards tried tries truly try trying twice two u un under unfortunately unless unlikely until unto up upon us use used useful uses using usually v value various very via viz vs w want wants was wasn't way we we'd we'll we're we've welcome well went were weren't what what's whatever when whence whenever where where's whereafter whereas whereby wherein whereupon wherever whether which while whither who who's whoever whole whom whose why will willing wish with within without won't wonder would would wouldn't x y yes yet you you'd you'll you're you've your yours yourself yourselves z zero ";
-
-# Words are separated by spaces (could be any character) so when doing search,
-# we search for a word with a space appended at the end and in front of a word.
+$wgFulltextStoplist = " a a's able about above according accordingly across actually after afterwards again against ain't all allow allows almost alone along already also although always am among amongst an and another any anybody anyhow anyone anything anyway anyways anywhere apart appear appreciate appropriate are aren't around as aside ask asking associated at available away awfully b be became because become becomes becoming been before beforehand behind being believe below beside besides best better between beyond both brief but by c c'mon c's came can can't cannot cant cause causes certain certainly changes clearly co com come comes concerning consequently consider considering contain containing contains corresponding could couldn't course currently d definitely described despite did didn't different do does doesn't doing don't done down downwards during e each edu eg eight either else elsewhere enough entirely especially et etc even ever every everybody everyone everything everywhere ex exactly example except f far few fifth first five followed following follows for former formerly forth four from further furthermore g get gets getting given gives go goes going gone got gotten greetings h had hadn't happens hardly has hasn't have haven't having he he's hello help hence her here here's hereafter hereby herein hereupon hers herself hi him himself his hither hopefully how howbeit however i i'd i'll i'm i've ie if ignored immediate in inasmuch inc indeed indicate indicated indicates inner insofar instead into inward is isn't it it'd it'll it's its itself j just k keep keeps kept know knows known l last lately later latter latterly least less lest let let's like liked likely little look looking looks ltd m mainly many may maybe me mean meanwhile merely might more moreover most mostly much must my myself n name namely nd near nearly necessary need needs neither never nevertheless new next nine no nobody non none noone nor normally not nothing novel now nowhere o obviously of off often oh ok okay old on once one ones only onto or other others otherwise ought our ours ourselves out outside over overall own p particular particularly per perhaps placed please plus possible presumably probably provides q que quite qv r rather rd re really reasonably regarding regardless regards relatively respectively right s said same saw say saying says second secondly see seeing seem seemed seeming seems seen self selves sensible sent serious seriously seven several shall she should shouldn't since six so some somebody somehow someone something sometime sometimes somewhat somewhere soon sorry specified specify specifying still sub such sup sure t t's take taken tell tends th than thank thanks thanx that that's thats the their theirs them themselves then thence there there's thereafter thereby therefore therein theres thereupon these they they'd they'll they're they've think third this thorough thoroughly those though three through throughout thru thus to together too took toward towards tried tries truly try trying twice two u un under unfortunately unless unlikely until unto up upon us use used useful uses using usually v value various very via viz vs w want wants was wasn't way we we'd we'll we're we've welcome well went were weren't what what's whatever when whence whenever where where's whereafter whereas whereby wherein whereupon wherever whether which while whither who who's whoever whole whom whose why will willing wish with within without won't wonder would would wouldn't x y yes yet you you'd you'll you're you've your yours yourself yourselves z zero ";
 
+/**
+ */
 class FulltextStoplist {
 
-       /* static */ function inList( $word )
+       /**
+        * @static
+        */
+       function inList( $word )
        {
                global $wgFulltextStoplist;
                # FIXME: this will fail badly in many circumstances
index 9d156dd..26b4ae2 100644 (file)
@@ -1,7 +1,14 @@
 <?php
-# Global functions used everywhere
 # $Id$
 
+/**
+ * Global functions used everywhere
+ */
+
+/**
+ * Some globals and requires needed
+ */
 $wgNumberOfArticles = -1; # Unset
 $wgTotalViews = -1;
 $wgTotalEdits = -1;
@@ -10,14 +17,12 @@ require_once( 'DatabaseFunctions.php' );
 require_once( 'UpdateClasses.php' );
 require_once( 'LogPage.php' );
 
-/*
+/**
  * Compatibility functions
- */
-
-# PHP <4.3.x is not actively supported; 4.1.x and 4.2.x might or might not work.
-# <4.1.x will not work, as we use a number of features introduced in 4.1.0
-# such as the new autoglobals.
-
+ * PHP <4.3.x is not actively supported; 4.1.x and 4.2.x might or might not work.
+ * <4.1.x will not work, as we use a number of features introduced in 4.1.0
+ * such as the new autoglobals.
+*/
 if( !function_exists('iconv') ) {
        # iconv support is not in the default configuration and so may not be present.
        # Assume will only ever use utf-8 and iso-8859-1.
@@ -61,8 +66,10 @@ if ( !function_exists( 'mb_substr' ) ) {
        }
 }
 
-# html_entity_decode exists in PHP 4.3.0+ but is FATALLY BROKEN even then,
-# with no UTF-8 support.
+/**
+ * html_entity_decode exists in PHP 4.3.0+ but is FATALLY BROKEN even then,
+ * with no UTF-8 support.
+ */
 function do_html_entity_decode( $string, $quote_style=ENT_COMPAT, $charset='ISO-8859-1' ) {
        static $trans;
        if( !isset( $trans ) ) {
@@ -79,8 +86,10 @@ function do_html_entity_decode( $string, $quote_style=ENT_COMPAT, $charset='ISO-
 
 $wgRandomSeeded = false;
 
-# Seed Mersenne Twister
-# Only necessary in PHP < 4.2.0
+/**
+ * Seed Mersenne Twister
+ * Only necessary in PHP < 4.2.0
+ */
 function wfSeedRandom()
 {
        global $wgRandomSeeded;
@@ -92,9 +101,10 @@ function wfSeedRandom()
        }
 }
 
-# Generates a URL from a URL-encoded title and a query string
-# Title::getLocalURL() is preferred in most cases
-#
+/**
+ * Generates a URL from a URL-encoded title and a query string
+ * Title::getLocalURL() is preferred in most cases
+ */
 function wfLocalUrl( $a, $q = '' )
 {
        global $wgServer, $wgScript, $wgArticlePath;
@@ -117,15 +127,19 @@ function wfLocalUrl( $a, $q = '' )
        return $a;
 }
 
+/**
+ * @todo document
+ */
 function wfLocalUrlE( $a, $q = '' )
 {
        return htmlspecialchars( wfLocalUrl( $a, $q ) );
        # die( "Call to obsolete function wfLocalUrlE()" );
 }
 
-# We want / and : to be included as literal characters in our title URLs.
-# %2F in the page titles seems to fatally break for some reason.
-#
+/**
+ * We want / and : to be included as literal characters in our title URLs.
+ * %2F in the page titles seems to fatally break for some reason.
+*/
 function wfUrlencode ( $s )
 {
        $s = urlencode( $s );
@@ -135,9 +149,10 @@ function wfUrlencode ( $s )
        return $s;
 }
 
-# Return the UTF-8 sequence for a given Unicode code point.
-# Currently doesn't work for values outside the Basic Multilingual Plane.
-#
+/**
+ * Return the UTF-8 sequence for a given Unicode code point.
+ * Currently doesn't work for values outside the Basic Multilingual Plane.
+*/
 function wfUtf8Sequence( $codepoint ) {
        if($codepoint <         0x80) return chr($codepoint);
        if($codepoint <    0x800) return chr($codepoint >>      6 & 0x3f | 0xc0) .
@@ -154,7 +169,9 @@ function wfUtf8Sequence( $codepoint ) {
        return "&#$codepoint;";
 }
 
-# Converts numeric character entities to UTF-8
+/**
+ * Converts numeric character entities to UTF-8
+ */
 function wfMungeToUtf8( $string ) {
        global $wgInputEncoding; # This is debatable
        #$string = iconv($wgInputEncoding, "UTF-8", $string);
@@ -164,8 +181,10 @@ function wfMungeToUtf8( $string ) {
        return $string;
 }
 
-# Converts a single UTF-8 character into the corresponding HTML character entity
-# (for use with preg_replace_callback)
+/**
+ * Converts a single UTF-8 character into the corresponding HTML character
+ * entity (for use with preg_replace_callback)
+ */
 function wfUtf8Entity( $matches ) {
        $char = $matches[0];
        # Find the length
@@ -201,11 +220,17 @@ function wfUtf8Entity( $matches ) {
        return "&#$z;";
 }
 
-# Converts all multi-byte characters in a UTF-8 string into the appropriate character entity
+/**
+ * Converts all multi-byte characters in a UTF-8 string into the appropriate
+ * character entity
+ */
 function wfUtf8ToHTML($string) {
        return preg_replace_callback( '/[\\xc0-\\xfd][\\x80-\\xbf]*/', 'wfUtf8Entity', $string );
 }
 
+/**
+ * @todo document
+ */
 function wfDebug( $text, $logonly = false )
 {
        global $wgOut, $wgDebugLogFile, $wgDebugComments, $wgProfileOnly, $wgDebugRawPage;
@@ -223,7 +248,9 @@ function wfDebug( $text, $logonly = false )
        }
 }
 
-# Log for database errors
+/**
+ * Log for database errors
+ */
 function wfLogDBError( $text ) {
        global $wgDBerrorLog;
        if ( $wgDBerrorLog ) {
@@ -232,6 +259,9 @@ function wfLogDBError( $text ) {
        }
 }
 
+/**
+ * @todo document
+ */
 function logProfilingData()
 {
        global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest;
@@ -263,8 +293,11 @@ function logProfilingData()
        }
 }
 
-# Check if the wiki read-only lock file is present. This can be used to lock off
-# editing functions, but doesn't guarantee that the database will not be modified.
+/**
+ * Check if the wiki read-only lock file is present. This can be used to lock
+ * off editing functions, but doesn't guarantee that the database will not be
+ * modified.
+ */
 function wfReadOnly() {
        global $wgReadOnlyFile;
 
@@ -276,7 +309,9 @@ function wfReadOnly() {
 
 $wgReplacementKeys = array( '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9' );
 
-# Get a message from anywhere
+/**
+ * Get a message from anywhere
+ */
 function wfMsg( $key ) {
        global $wgRequest;
        if ( $wgRequest->getVal( 'debugmsg' ) ) {
@@ -292,7 +327,9 @@ function wfMsg( $key ) {
        return wfMsgReal( $key, $args, true );
 }
 
-# Get a message from the language file
+/**
+ * Get a message from the language file
+ */
 function wfMsgNoDB( $key ) {
        $args = func_get_args();
        if ( count( $args ) ) {
@@ -301,7 +338,9 @@ function wfMsgNoDB( $key ) {
        return wfMsgReal( $key, $args, false );
 }
 
-# Really get a message
+/**
+ * Really get a message
+ */
 function wfMsgReal( $key, $args, $useDB ) {
        global $wgReplacementKeys, $wgMessageCache, $wgLang;
 
@@ -324,8 +363,10 @@ function wfMsgReal( $key, $args, $useDB ) {
        return $message;
 }
 
-# Just like exit() but makes a note of it.
-# Commits open transactions except if the error parameter is set
+/**
+ * Just like exit() but makes a note of it.
+ * Commits open transactions except if the error parameter is set
+ */
 function wfAbruptExit( $error = false ){
        global $wgLoadBalancer;
        static $called = false;
@@ -350,13 +391,17 @@ function wfAbruptExit( $error = false ){
        exit();
 }
 
+/**
+ * @todo document
+ */
 function wfErrorExit() {
        wfAbruptExit( true );
 }
 
-# This is meant as a debugging aid to track down where bad data comes from.
-# Shouldn't be used in production code except maybe in "shouldn't happen" areas.
-#
+/**
+ * This is meant as a debugging aid to track down where bad data comes from.
+ * Shouldn't be used in production code except maybe in "shouldn't happen" areas.
+ */
 function wfDebugDieBacktrace( $msg = '' ) {
        global $wgCommandLineMode;
 
@@ -466,18 +511,22 @@ function wfClientAcceptsGzip() {
        return false;
 }
 
-# Yay, more global functions!
+/**
+ * Yay, more global functions!
+ */
 function wfCheckLimits( $deflimit = 50, $optionname = 'rclimit' ) {
        global $wgRequest;
        return $wgRequest->getLimitOffset( $deflimit, $optionname );
 }
 
-# Escapes the given text so that it may be output using addWikiText()
-# without any linking, formatting, etc. making its way through. This
-# is achieved by substituting certain characters with HTML entities.
-# As required by the callers, <nowiki> is not used. It currently does
-# not filter out characters which have special meaning only at the
-# start of a line, such as "*".
+/**
+ * Escapes the given text so that it may be output using addWikiText()
+ * without any linking, formatting, etc. making its way through. This
+ * is achieved by substituting certain characters with HTML entities.
+ * As required by the callers, <nowiki> is not used. It currently does
+ * not filter out characters which have special meaning only at the
+ * start of a line, such as "*".
+ */
 function wfEscapeWikiText( $text )
 {
        $text = str_replace( 
@@ -511,15 +560,19 @@ function wfTime(){
        return (float)$st[0] + (float)$st[1];
 }
 
-# Changes the first character to an HTML entity
+/**
+ * Changes the first character to an HTML entity
+ */
 function wfHtmlEscapeFirst( $text ) {
        $ord = ord($text);
        $newText = substr($text, 1);
        return "&#$ord;$newText";
 }
 
-# Sets dest to source and returns the original value of dest
-# If source is NULL, it just returns the value, it doesn't set the variable
+/**
+ * Sets dest to source and returns the original value of dest
+ * If source is NULL, it just returns the value, it doesn't set the variable
+ */
 function wfSetVar( &$dest, $source )
 {
        $temp = $dest;
@@ -529,7 +582,9 @@ function wfSetVar( &$dest, $source )
        return $temp;
 }
 
-# As for wfSetVar except setting a bit
+/**
+ * As for wfSetVar except setting a bit
+ */
 function wfSetBit( &$dest, $bit, $state = true ) {
        $temp = (bool)($dest & $bit );
        if ( !is_null( $state ) ) {
@@ -542,9 +597,11 @@ function wfSetBit( &$dest, $bit, $state = true ) {
        return $temp;
 }
 
-# This function takes two arrays as input, and returns a CGI-style string, e.g.
-# "days=7&limit=100". Options in the first array override options in the second.
-# Options set to "" will not be output.
+/**
+ * This function takes two arrays as input, and returns a CGI-style string, e.g.
+ * "days=7&limit=100". Options in the first array override options in the second.
+ * Options set to "" will not be output.
+ */
 function wfArrayToCGI( $array1, $array2 = NULL )
 {
        if ( !is_null( $array2 ) ) {
@@ -563,14 +620,19 @@ function wfArrayToCGI( $array1, $array2 = NULL )
        return $cgi;
 }
 
-# This is obsolete, use SquidUpdate::purge()
+/**
+ * This is obsolete, use SquidUpdate::purge()
+ * @deprecated
+ */
 function wfPurgeSquidServers ($urlArr) {
        SquidUpdate::purge( $urlArr );
 }
 
-# Windows-compatible version of escapeshellarg()
-# Windows doesn't recognise single-quotes in the shell, but the escapeshellarg() 
-# function puts single quotes in regardless of OS
+/**
+ * Windows-compatible version of escapeshellarg()
+ * Windows doesn't recognise single-quotes in the shell, but the escapeshellarg() 
+ * function puts single quotes in regardless of OS
+ */
 function wfEscapeShellArg( )
 {
        $args = func_get_args();
@@ -592,9 +654,10 @@ function wfEscapeShellArg( )
        return $retVal;
 }
 
-# wfMerge attempts to merge differences between three texts.
-# Returns true for a clean merge and false for failure or a conflict.
-
+/**
+ * wfMerge attempts to merge differences between three texts.
+ * Returns true for a clean merge and false for failure or a conflict.
+ */
 function wfMerge( $old, $mine, $yours, &$result ){
        global $wgDiff3;
 
@@ -645,6 +708,9 @@ function wfMerge( $old, $mine, $yours, &$result ){
        return ! $conflict;
 }
 
+/**
+ * @todo document
+ */
 function wfVarDump( $var )
 {
        global $wgOut;
@@ -656,7 +722,9 @@ function wfVarDump( $var )
        }
 }
 
-# Provide a simple HTTP error.
+/**
+ * Provide a simple HTTP error.
+ */
 function wfHttpError( $code, $label, $desc ) {
        global $wgOut;
        $wgOut->disable();
@@ -671,7 +739,10 @@ function wfHttpError( $code, $label, $desc ) {
        }
 }
 
-# Converts an Accept-* header into an array mapping string values to quality factors
+/**
+ * Converts an Accept-* header into an array mapping string values to quality
+ * factors
+ */
 function wfAcceptToPrefs( $accept, $def = '*/*' ) {
        # No arg means accept anything (per HTTP spec)
        if( !$accept ) {
@@ -695,7 +766,11 @@ function wfAcceptToPrefs( $accept, $def = '*/*' ) {
        return $prefs;
 }
 
-/* private */ function mimeTypeMatch( $type, $avail ) {
+/**
+ * @todo document
+ * @private
+ */
+function mimeTypeMatch( $type, $avail ) {
        if( array_key_exists($type, $avail) ) {
                return $type;
        } else {
@@ -710,8 +785,10 @@ function wfAcceptToPrefs( $accept, $def = '*/*' ) {
        }
 }
 
-# FIXME: doesn't handle params like 'text/plain; charset=UTF-8'
-# XXX: generalize to negotiate other stuff
+/**
+ * @todo FIXME: doesn't handle params like 'text/plain; charset=UTF-8'
+ * XXX: generalize to negotiate other stuff
+ */
 function wfNegotiateType( $cprefs, $sprefs ) {
        $combine = array();
 
@@ -748,16 +825,21 @@ function wfNegotiateType( $cprefs, $sprefs ) {
        return $besttype;
 }
 
-# Array lookup
-# Returns an array where the values in the first array are replaced by the
-# values in the second array with the corresponding keys
+/**
+ * Array lookup
+ * Returns an array where the values in the first array are replaced by the
+ * values in the second array with the corresponding keys
+ */
 function wfArrayLookup( $a, $b )
 {
        return array_flip( array_intersect( array_flip( $a ), array_keys( $b ) ) );
 }
 
 
-# Ideally we'd be using actual time fields in the db
+/**
+ * Ideally we'd be using actual time fields in the db
+ * @todo fixme
+ */
 function wfTimestamp2Unix( $ts ) {
        return gmmktime( ( (int)substr( $ts, 8, 2) ),
                  (int)substr( $ts, 10, 2 ), (int)substr( $ts, 12, 2 ),
@@ -774,7 +856,9 @@ function wfTimestampNow() {
        return gmdate( 'YmdHis' );
 }
 
-# Sorting hack for MySQL 3, which doesn't use index sorts for DESC
+/**
+ * Sorting hack for MySQL 3, which doesn't use index sorts for DESC
+ */
 function wfInvertTimestamp( $ts ) {
        return strtr(
                $ts,
@@ -783,7 +867,9 @@ function wfInvertTimestamp( $ts ) {
        );
 }
 
-# Reference-counted warning suppression
+/**
+ * Reference-counted warning suppression
+ */
 function wfSuppressWarnings( $end = false ) {
        static $suppressCount = 0;
        static $originalLevel = false;
@@ -803,7 +889,9 @@ function wfSuppressWarnings( $end = false ) {
        }
 }
 
-# Restore error level to previous value
+/**
+ * Restore error level to previous value
+ */
 function wfRestoreWarnings() {
        wfSuppressWarnings( true );
 }
@@ -813,6 +901,9 @@ define('TS_UNIX',0);        # Standard unix timestamp (number of seconds since 1 Jan 19
 define('TS_MW',1);     # Mediawiki concatenated string timestamp (yyyymmddhhmmss)
 define('TS_DB',2);     # Standard database timestamp (yyyy-mm-dd hh:mm:ss)
 
+/**
+ * @todo document
+ */
 function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
        if (preg_match("/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/",$ts,$da)) {
                # TS_DB
@@ -844,6 +935,9 @@ function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
        }
 }
 
+/**
+ * @todo document
+ */
 function wfIsWindows() {   
        if (substr(php_uname(), 0, 7) == 'Windows') {   
                return true;   
index cf170b7..10251fb 100644 (file)
@@ -1,6 +1,11 @@
 <?php
+/**
+ *
+ */
 
-# Pure virtual parent
+/**
+ * Pure virtual parent
+ */
 class HistoryBlob
 {
        function setMeta() {}
@@ -9,7 +14,9 @@ class HistoryBlob
        function getItem() {}
 }
 
-# The real object
+/**
+ * The real object
+ */
 class ConcatenatedGzipHistoryBlob
 {
        /* private */ var $mVersion = 0, $mCompressed = false, $mItems = array();
index 5a1af68..275f6d6 100644 (file)
@@ -1,8 +1,14 @@
 <?php
-# Class to represent an image
-# Provides methods to retrieve paths (physical, logical, URL),
-# to generate thumbnails or for uploading.
-
+/**
+ *
+ */
+
+/**
+ * Class to represent an image
+ * 
+ * Provides methods to retrieve paths (physical, logical, URL),
+ * to generate thumbnails or for uploading.
+ */
 class Image
 {
        /* private */
@@ -123,13 +129,14 @@ class Image
                return $width."px-".$this->name;
        }
 
-       //**********************************************************************
-       // Create a thumbnail of the image having the specified width.
-       // The thumbnail will not be created if the width is larger than the
-       // image's width. Let the browser do the scaling in this case.
-       // The thumbnail is stored on disk and is only computed if the thumbnail
-       // file does not exist OR if it is older than the image.
-       // Returns the URL.
+       /**
+        * Create a thumbnail of the image having the specified width.
+        * The thumbnail will not be created if the width is larger than the
+        * image's width. Let the browser do the scaling in this case.
+        * The thumbnail is stored on disk and is only computed if the thumbnail
+        * file does not exist OR if it is older than the image.
+        * Returns the URL.
+        */
        function createThumb( $width ) {
                global $wgUploadDirectory;
                global $wgImageMagickConvertCommand;
@@ -254,13 +261,14 @@ class Image
                return $thumbUrl;
        } // END OF function createThumb
 
-       //**********************************************************************
-       // Return the image history of this image, line by line.
-       // starts with current version, then old versions.
-       // uses $this->historyLine to check which line to return:
-       //  0      return line for current version
-       //  1      query for old versions, return first one
-       //  2, ... return next old version from above query
+       /**
+        * Return the image history of this image, line by line.
+        * starts with current version, then old versions.
+        * uses $this->historyLine to check which line to return:
+        *  0      return line for current version
+        *  1      query for old versions, return first one
+        *  2, ... return next old version from above query
+        */
        function nextHistoryLine()
        {
                $fname = 'Image::nextHistoryLine()';
index 49251f1..42c219e 100644 (file)
@@ -1,11 +1,16 @@
 <?php
+/**
+ *
+ */
 
-/*
-       Special handling for image description pages
-*/
-
+/**
+ *
+ */
 require_once( 'Image.php' );
 
+/**
+ * Special handling for image description pages
+ */
 class ImagePage extends Article {
 
        /* private */ var $img;  // Image object this page is shown for. Initilaized in openShowImage, not
@@ -68,9 +73,10 @@ class ImagePage extends Article {
                # For overloading
        }
 
-       # If the page we've just displayed is in the "Image" namespace,
-       # we follow it with an upload history of the image and its usage.
-
+       /**
+        * If the page we've just displayed is in the "Image" namespace,
+        * we follow it with an upload history of the image and its usage.
+        */
        function imageHistory()
        {
                global $wgUser, $wgOut;
index 0dfcd87..608f4bf 100644 (file)
@@ -1,5 +1,6 @@
 <?
-
-/* This file is obsolete... 2003-08-21 */
-
+/**
+ * This file is obsolete... 2003-08-21
+ * @deprecated
+ */
 ?>
index 10aac8b..ce4594b 100644 (file)
@@ -1,11 +1,19 @@
 <?php
-# Cache for article titles (prefixed DB keys) and ids linked from one source
+/**
+ * Cache for article titles (prefixed DB keys) and ids linked from one source
+ */
 
+/**
+ *
+ */
 # These are used in incrementalSetup()
 define ('LINKCACHE_GOOD', 0);
 define ('LINKCACHE_BAD', 1);
 define ('LINKCACHE_IMAGE', 2);
 
+/**
+ *
+ */
 class LinkCache {      
        // Increment $mClassVer whenever old serialized versions of this class
        // becomes incompatible with the new version.
@@ -21,8 +29,7 @@ class LinkCache {
                return $wgDBname.':lc:title:'.$title;
        }
        
-       function LinkCache()
-       {
+       function LinkCache() {
                $this->mActive = true;
                $this->mPreFilled = false;
                $this->mForUpdate = false;
@@ -34,13 +41,14 @@ class LinkCache {
                $this->mOldBadLinks = array();
        }
 
-       # General accessor to get/set whether SELECT FOR UPDATE should be used
+       /**
+        * General accessor to get/set whether SELECT FOR UPDATE should be used
+        */
        function forUpdate( $update = NULL ) { 
                return wfSetVar( $this->mForUpdate, $update );
        }
        
-       function getGoodLinkID( $title )
-       {
+       function getGoodLinkID( $title ) {
                if ( array_key_exists( $title, $this->mGoodLinks ) ) {
                        return $this->mGoodLinks[$title];
                } else {
@@ -48,32 +56,27 @@ class LinkCache {
                }
        }
 
-       function isBadLink( $title )
-       {
+       function isBadLink( $title ) {
                return array_key_exists( $title, $this->mBadLinks ); 
        }
 
-       function addGoodLink( $id, $title )
-       {
+       function addGoodLink( $id, $title ) {
                if ( $this->mActive ) {
                        $this->mGoodLinks[$title] = $id;
                }
        }
 
-       function addBadLink( $title )
-       {
+       function addBadLink( $title ) {
                if ( $this->mActive && ( ! $this->isBadLink( $title ) ) ) {
                        $this->mBadLinks[$title] = 1;
                }
        }
 
-       function addImageLink( $title )
-       {
+       function addImageLink( $title ) {
                if ( $this->mActive ) { $this->mImageLinks[$title] = 1; }
        }
 
-       function addImageLinkObj( $nt )
-       {
+       function addImageLinkObj( $nt ) {
                if ( $this->mActive ) { $this->mImageLinks[$nt->getDBkey()] = 1; }
        }
        
@@ -85,14 +88,12 @@ class LinkCache {
                $this->addCategoryLink( $nt->getDBkey(), $sortkey );
        }
 
-       function clearBadLink( $title )
-       {
+       function clearBadLink( $title ) {
                unset( $this->mBadLinks[$title] );
                $this->clearLink( $title );
        }
        
-       function clearLink( $title ) 
-       {
+       function clearLink( $title ) {
                global $wgMemc, $wgLinkCacheMemcached;
                if( $wgLinkCacheMemcached )
                        $wgMemc->delete( $this->getKey( $title ) );
@@ -105,8 +106,7 @@ class LinkCache {
        function getImageLinks() { return $this->mImageLinks; }
        function getCategoryLinks() { return $this->mCategoryLinks; }
 
-       function addLink( $title )
-       {
+       function addLink( $title ) {
                $nt = Title::newFromDBkey( $title );
                if( $nt ) {
                        return $this->addLinkObj( $nt );
@@ -115,8 +115,7 @@ class LinkCache {
                }
        }
        
-       function addLinkObj( &$nt )
-       {
+       function addLinkObj( &$nt ) {
                global $wgMemc, $wgLinkCacheMemcached;
                $title = $nt->getPrefixedDBkey();
                if ( $this->isBadLink( $title ) ) { return 0; }         
@@ -160,8 +159,7 @@ class LinkCache {
                return $id;
        }
 
-       function preFill( &$fromtitle )
-       {
+       function preFill( &$fromtitle ) {
                global $wgEnablePersistentLC;
 
                $fname = 'LinkCache::preFill';
@@ -220,44 +218,43 @@ class LinkCache {
                wfProfileOut( $fname );
        }
 
-       function getGoodAdditions() 
-       {
+       function getGoodAdditions() {
                return array_diff( $this->mGoodLinks, $this->mOldGoodLinks );
        }
 
-       function getBadAdditions() 
-       {
+       function getBadAdditions() {
                #wfDebug( "mOldBadLinks: " . implode( ', ', array_keys( $this->mOldBadLinks ) ) . "\n" );
                #wfDebug( "mBadLinks: " . implode( ', ', array_keys( $this->mBadLinks ) ) . "\n" );
                return array_values( array_diff( array_keys( $this->mBadLinks ), array_keys( $this->mOldBadLinks ) ) );
        }
 
-       function getImageAdditions()
-       {
+       function getImageAdditions() {
                return array_diff_assoc( $this->mImageLinks, $this->mOldImageLinks );
        }
 
-       function getGoodDeletions() 
-       {
+       function getGoodDeletions() {
                return array_diff( $this->mOldGoodLinks, $this->mGoodLinks );
        }
 
-       function getBadDeletions()
-       {
+       function getBadDeletions() {
                return array_values( array_diff( array_keys( $this->mOldBadLinks ), array_keys( $this->mBadLinks ) ));
        }
 
-       function getImageDeletions()
-       {
+       function getImageDeletions() {
                return array_diff_assoc( $this->mOldImageLinks, $this->mImageLinks );
        }
 
-       #     Parameters: $which is one of the LINKCACHE_xxx constants, $del and $add are 
-       # the incremental update arrays which will be filled. Returns whether or not it's
-       # worth doing the incremental version. For example, if [[List of mathematical topics]]
-       # was blanked, it would take a long, long time to do incrementally.
-       function incrementalSetup( $which, &$del, &$add )
-       {
+       /**
+        * Parameters:
+        * @param $which is one of the LINKCACHE_xxx constants
+        * @param $del,$add are the incremental update arrays which will be filled.
+        *
+        * @return Returns whether or not it's worth doing the incremental version.
+        *
+        * For example, if [[List of mathematical topics]] was blanked,
+        * it would take a long, long time to do incrementally.
+        */
+       function incrementalSetup( $which, &$del, &$add ) {
                if ( ! $this->mPreFilled ) {
                        return false;
                }
@@ -282,15 +279,19 @@ class LinkCache {
                return true;
        }
 
-       # Clears cache but leaves old preFill copies alone
-       function clear() 
-       {
+       /**
+        * Clears cache but leaves old preFill copies alone
+        */
+       function clear() {
                $this->mGoodLinks = array();
                $this->mBadLinks = array();
                $this->mImageLinks = array();
        }
 
-       /* private */ function fillFromLinkscc( $id ){ 
+       /**
+        * @access private
+        */
+       function fillFromLinkscc( $id ){ 
                $fname = 'LinkCache::fillFromLinkscc';
 
                $id = IntVal( $id );
@@ -325,7 +326,10 @@ class LinkCache {
 
        }
 
-       /* private */ function saveToLinkscc( $pid ){
+       /**
+        * @access private
+        */
+       function saveToLinkscc( $pid ){
                global $wgCompressedPersistentLC;
                if( $wgCompressedPersistentLC and function_exists( 'gzcompress' ) ) {
                        $ser = gzcompress( serialize( $this ), 3 );
@@ -336,9 +340,12 @@ class LinkCache {
                $db->replace( 'linkscc', array( 'lcc_pageid' ), array( 'lcc_pageid' => $pid, 'lcc_cacheobj' => $ser ) );
        }
 
-       # Delete linkscc rows which link to here
-       # $pid is a page id
-       /* static */ function linksccClearLinksTo( $pid ){
+       /**
+        * Delete linkscc rows which link to here
+        * @param $pid is a page id
+        * @static
+        */
+       function linksccClearLinksTo( $pid ){
                global $wgEnablePersistentLC;
                if ( $wgEnablePersistentLC ) {
                        $fname = 'LinkCache::linksccClearLinksTo';
@@ -352,9 +359,12 @@ class LinkCache {
 
        }
 
-       # Delete linkscc rows with broken links to here
-       # $title is a prefixed db title, for example like Title->getPrefixedDBkey() returns.
-       /* static */ function linksccClearBrokenLinksTo( $title ){
+       /**
+        * Delete linkscc rows with broken links to here
+        * @param $title is a prefixed db title for example like Title->getPrefixedDBkey() returns.
+        * @static
+        */
+       function linksccClearBrokenLinksTo( $title ){
                global $wgEnablePersistentLC;
                $fname = 'LinkCache::linksccClearBrokenLinksTo';
 
@@ -364,8 +374,11 @@ class LinkCache {
                }
        }
 
-       # $pid is a page id
-       /* static */ function linksccClearPage( $pid ){
+       /**
+        * @param $pid is a page id
+        * @static
+        */
+       function linksccClearPage( $pid ){
                global $wgEnablePersistentLC;
                if ( $wgEnablePersistentLC ) {
                        $pid = intval( $pid );
index 5b9cf54..b9e3f03 100644 (file)
@@ -1,6 +1,11 @@
 <?php
-# See deferred.doc
+/**
+ * See deferred.doc
+ */
 
+/**
+ * @todo document
+ */
 class LinksUpdate {
 
        /* private */ var $mId, $mTitle;
index 13f01fc..69b5cd3 100644 (file)
@@ -1,6 +1,11 @@
 <?php
-# Database load balancing object
+/**
+ *
+ */
 
+/**
+ * Depends on the database object
+ */
 require_once( 'Database.php' );
 
 # Valid database indexes
@@ -26,6 +31,10 @@ define( 'DB_TASK_LAST', 1004) ;   # Last in list
 
 define( 'MASTER_WAIT_TIMEOUT', 15 ); # Time to wait for a slave to synchronise
 
+/**
+ * Database load balancing object
+ * @todo document
+ */
 class LoadBalancer {
        /* private */ var $mServers, $mConnections, $mLoads;
        /* private */ var $mFailFunction;
@@ -67,8 +76,10 @@ class LoadBalancer {
                }
        }
        
-       # Given an array of non-normalised probabilities, this function will select
-       # an element and return the appropriate key
+       /**
+        * Given an array of non-normalised probabilities, this function will select
+        * an element and return the appropriate key
+        */
        function pickRandom( $weights )
        {
                if ( !is_array( $weights ) || count( $weights ) == 0 ) {
@@ -131,9 +142,11 @@ class LoadBalancer {
                return $i;
        }
 
-       # Set the master wait position
-       # If a DB_SLAVE connection has been opened already, waits
-       # Otherwise sets a variable telling it to wait if such a connection is opened
+       /**
+        * Set the master wait position
+        * If a DB_SLAVE connection has been opened already, waits
+        * Otherwise sets a variable telling it to wait if such a connection is opened
+        */
        function waitFor( $file, $pos ) {
                $fname = 'LoadBalancer::waitFor';
                wfProfileIn( $fname );
@@ -156,7 +169,9 @@ class LoadBalancer {
                wfProfileOut( $fname );
        }
 
-       # Wait for a given slave to catch up to the master pos stored in $this
+       /**
+        * Wait for a given slave to catch up to the master pos stored in $this
+        */
        function doWait( $index ) {
                global $wgMemc;
                
@@ -189,7 +204,9 @@ class LoadBalancer {
                return $retVal;
        }               
 
-       # Get a connection by index
+       /**
+        * Get a connection by index
+        */
        function &getConnection( $i, $fail = true )
        {
                $fname = 'LoadBalancer::getConnection';
@@ -226,9 +243,12 @@ class LoadBalancer {
                return $this->mConnections[$i];
        }
 
-       # Open a connection to the server given by the specified index
-       # Index must be an actual index into the array
-       /* private */ function openConnection( $i, $fail = false ) {
+       /**
+        * Open a connection to the server given by the specified index
+        * Index must be an actual index into the array
+        * @private
+        */
+       function openConnection( $i, $fail = false ) {
                $fname = 'LoadBalancer::openConnection';
                wfProfileIn( $fname );
 
@@ -258,8 +278,11 @@ class LoadBalancer {
                wfProfileOut( $fname );
        }
 
-       # Test if the specified index represents an open connection
-       /* private */ function isOpen( $index ) {
+       /**
+        * Test if the specified index represents an open connection
+        * @private
+        */
+       function isOpen( $index ) {
                if( !is_integer( $index ) ) {
                        return false;
                }
@@ -272,8 +295,11 @@ class LoadBalancer {
                }
        }
        
-       # Really opens a connection
-       /* private */ function reallyOpenConnection( &$server ) {
+       /**
+        * Really opens a connection
+        * @private
+        */
+       function reallyOpenConnection( &$server ) {
                        extract( $server );
                        # Get class for this database type
                        $class = 'Database' . ucfirst( $type );
@@ -323,12 +349,16 @@ class LoadBalancer {
                return array_key_exists( $i, $this->mServers );
        }
 
-       # Get the number of defined servers (not the number of open connections)
+       /**
+        * Get the number of defined servers (not the number of open connections)
+        */
        function getServerCount() {
                return count( $this->mServers );
        }
 
-       # Save master pos to the session and to memcached, if the session exists
+       /**
+        * Save master pos to the session and to memcached, if the session exists
+        */
        function saveMasterPos() {
                global $wgSessionStarted;
                if ( $wgSessionStarted && count( $this->mServers ) > 1 ) {
@@ -350,14 +380,18 @@ class LoadBalancer {
                }
        }
 
-       # Loads the master pos from the session, waits for it if necessary
+       /**
+        * Loads the master pos from the session, waits for it if necessary
+        */
        function loadMasterPos() {
                if ( isset( $_SESSION['master_log_file'] ) && isset( $_SESSION['master_pos'] ) ) {
                        $this->waitFor( $_SESSION['master_log_file'], $_SESSION['master_pos'] );
                }
        }
 
-       # Close all open connections
+       /**
+        * Close all open connections
+        */
        function closeAll() {
                foreach( $this->mConnections as $i => $conn ) {
                        if ( $this->isOpen( $i ) ) {
index 590daa0..c2f0d6a 100644 (file)
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
-# Class to simplify the use of log pages.
-# The logs are now kept in a table which is easier to manage and trim
-# than ever-growing wiki pages.
+/**
+ * Contain log classes
+ */
 
+/**
+ * Class to simplify the use of log pages.
+ * The logs are now kept in a table which is easier to manage and trim
+ * than ever-growing wiki pages.
+ */
 class LogPage {
        /* private */ var $type, $action, $comment;
        var $updateRecentChanges = true;
@@ -66,12 +71,18 @@ class LogPage {
                return true;
        }
 
-       /* static */ function validTypes() {
+       /**
+        * @static
+        */
+       function validTypes() {
                static $types = array( '', 'block', 'protect', 'rights', 'delete', 'upload' );
                return $types;
        }
        
-       /* static */ function validActions( $type ) {
+       /**
+        * @static
+        */
+       function validActions( $type ) {
                static $actions = array(
                        '' => NULL,
                        'block' => array( 'block', 'unblock' ),
@@ -83,11 +94,17 @@ class LogPage {
                return $actions[$type];
        }
        
-       /* static */ function isLogType( $type ) {
+       /**
+        * @static
+        */
+       function isLogType( $type ) {
                return in_array( $type, LogPage::validTypes() );
        }
        
-       /* static */ function logName( $type ) {
+       /**
+        * @static
+        */
+       function logName( $type ) {
                static $typeText = array(
                        ''        => 'log',
                        'block'   => 'blocklogpage',
@@ -99,7 +116,10 @@ class LogPage {
                return str_replace( '_', ' ', wfMsg( $typeText[$type] ) );
        }
        
-       /* static */ function logHeader( $type ) {
+       /**
+        * @static
+        */
+       function logHeader( $type ) {
                static $headerText = array(
                        ''        => 'alllogstext',
                        'block'   => 'blocklogtext',
@@ -111,7 +131,10 @@ class LogPage {
                return wfMsg( $headerText[$type] );
        }
        
-       /* static */ function actionText( $type, $action, $titleLink = NULL ) {
+       /**
+        * @static
+        */
+       function actionText( $type, $action, $titleLink = NULL ) {
                static $actions = array(
                        'block/block' => 'blocklogentry',
                        'block/unblock' => 'blocklogentry',
index 707e8a3..64a2e83 100644 (file)
@@ -1,17 +1,13 @@
 <?php
+/**
+ * File for magic words
+ */
 
-# This class encapsulates "magic words" such as #redirect, __NOTOC__, etc.
-# Usage:
-#     if (MagicWord::get( MAG_REDIRECT )->match( $text ) )
-# 
-# Possible future improvements: 
-#   * Simultaneous searching for a number of magic words
-#   * $wgMagicWords in shared memory
-#
-# Please avoid reading the data out of one of these objects and then writing 
-# special case code. If possible, add another match()-like function here.
+/**
+ * private
+ */
+$wgMagicFound = false;
 
-/*private*/ $wgMagicFound = false;
 
 define('MAG_REDIRECT', 0);
 define('MAG_NOTOC', 1);
@@ -65,6 +61,18 @@ $wgVariableIDs = array(
        MAG_NAMESPACE
 );
 
+/**
+ * This class encapsulates "magic words" such as #redirect, __NOTOC__, etc.
+ * Usage:
+ *     if (MagicWord::get( MAG_REDIRECT )->match( $text ) )
+ * 
+ * Possible future improvements: 
+ *   * Simultaneous searching for a number of magic words
+ *   * $wgMagicWords in shared memory
+ *
+ * Please avoid reading the data out of one of these objects and then writing 
+ * special case code. If possible, add another match()-like function here.
+ */
 class MagicWord {
        /*private*/ var $mId, $mSynonyms, $mCaseSensitive, $mRegex;
        /*private*/ var $mRegexStart, $mBaseRegex, $mVariableRegex;
@@ -81,8 +89,11 @@ class MagicWord {
                $this->mModified = false;
        }
 
-       # Factory: creates an object representing an ID
-       /*static*/ function &get( $id ) {
+       /**
+        * Factory: creates an object representing an ID
+        * @static
+        */
+       function &get( $id ) {
                global $wgMagicWords;
                
                if ( !is_array( $wgMagicWords ) ) {
@@ -103,8 +114,11 @@ class MagicWord {
                $wgLang->getMagic( $this );
        }
        
-       # Preliminary initialisation
-       /* private */ function initRegex() {
+       /**
+        * Preliminary initialisation
+        * @private
+        */
+       function initRegex() {
                $variableClass = Title::legalChars();
                $escSyn = array_map( 'preg_quote', $this->mSynonyms );
                $this->mBaseRegex = implode( '|', $escSyn );
@@ -116,7 +130,9 @@ class MagicWord {
                        "/^({$this->mBaseRegex})$/{$case}" );
        }
        
-       # Gets a regex representing matching the word
+       /**
+        * Gets a regex representing matching the word
+        */
        function getRegex() {
                if ($this->mRegex == '' ) {
                        $this->initRegex();
@@ -124,8 +140,9 @@ class MagicWord {
                return $this->mRegex;
        }
 
-       # Gets a regex matching the word, if it is at the 
-       # string start
+       /**
+        * Gets a regex matching the word, if it is at the string start
+        */
        function getRegexStart() {
                if ($this->mRegex == '' ) {
                        $this->initRegex();
@@ -133,7 +150,9 @@ class MagicWord {
                return $this->mRegexStart;
        }
 
-       # regex without the slashes and what not
+       /**
+        * regex without the slashes and what not
+        */
        function getBaseRegex() {
                if ($this->mRegex == '') {
                        $this->initRegex();
@@ -141,20 +160,28 @@ class MagicWord {
                return $this->mBaseRegex;
        }
                
-       # Returns true if the text contains the word
+       /**
+        * Returns true if the text contains the word
+        * @return bool
+        */
        function match( $text ) {
                return preg_match( $this->getRegex(), $text );
        }
 
-       # Returns true if the text starts with the word
+       /**
+        * Returns true if the text starts with the word
+        * @return bool
+        */
        function matchStart( $text ) {
                return preg_match( $this->getRegexStart(), $text );
        }
 
-       # Returns NULL if there's no match, the value of $1 otherwise
-       # The return code is the matched string, if there's no variable
-       # part in the regex and the matched variable part ($1) if there
-       # is one.
+       /**
+        * Returns NULL if there's no match, the value of $1 otherwise
+        * The return code is the matched string, if there's no variable
+        * part in the regex and the matched variable part ($1) if there
+        * is one.
+        */
        function matchVariableStartToEnd( $text ) {
                $matchcount = preg_match( $this->getVariableStartToEndRegex(), $text, $matches );
                if ( $matchcount == 0 ) {
@@ -167,8 +194,10 @@ class MagicWord {
        }
 
 
-       # Returns true if the text matches the word, and alters the
-       # input string, removing all instances of the word
+       /**
+        * Returns true if the text matches the word, and alters the
+        * input string, removing all instances of the word
+        */
        function matchAndRemove( &$text ) {
                global $wgMagicFound;
                $wgMagicFound = false;
@@ -184,16 +213,20 @@ class MagicWord {
        }               
 
 
-       # Replaces the word with something else
+       /**
+        * Replaces the word with something else
+        */
        function replace( $replacement, $subject ) {
                $res = preg_replace( $this->getRegex(), $replacement, $subject );
                $this->mModified = !($res === $subject);
                return $res;
        }
 
-       # Variable handling: {{SUBST:xxx}} style words
-       # Calls back a function to determine what to replace xxx with
-       # Input word must contain $1
+       /**
+        * Variable handling: {{SUBST:xxx}} style words
+        * Calls back a function to determine what to replace xxx with
+        * Input word must contain $1
+        */
        function substituteCallback( $text, $callback ) {
                $regex = $this->getVariableRegex();
                $res = preg_replace_callback( $this->getVariableRegex(), $callback, $text );
@@ -201,7 +234,9 @@ class MagicWord {
                return $res;
        }
 
-       # Matches the word, where $1 is a wildcard
+       /**
+        * Matches the word, where $1 is a wildcard
+        */
        function getVariableRegex()     {
                if ( $this->mVariableRegex == '' ) {
                        $this->initRegex();
@@ -209,7 +244,9 @@ class MagicWord {
                return $this->mVariableRegex;
        }
 
-       # Matches the entire string, where $1 is a wildcard
+       /**
+        * Matches the entire string, where $1 is a wildcard
+        */
        function getVariableStartToEndRegex() {
                if ( $this->mVariableStartToEndRegex == '' ) {
                        $this->initRegex();
@@ -217,23 +254,29 @@ class MagicWord {
                return $this->mVariableStartToEndRegex;
        }
 
-       # Accesses the synonym list directly
+       /**
+        * Accesses the synonym list directly
+        */
        function getSynonym( $i ) {
                return $this->mSynonyms[$i];
        }
 
-       # Returns true if the last call to replace() or substituteCallback() 
-       # returned a modified text, otherwise false.
+       /**
+        * Returns true if the last call to replace() or substituteCallback() 
+        * returned a modified text, otherwise false.
+        */
        function getWasModified(){
                return $this->mModified;
        }
 
-       # $magicarr is an associative array of (magic word ID => replacement)
-       # This method uses the php feature to do several replacements at the same time,
-       # thereby gaining some efficiency. The result is placed in the out variable
-       # $result. The return value is true if something was replaced.
-
-       /* static */ function replaceMultiple( $magicarr, $subject, &$result ){
+       /**
+        * $magicarr is an associative array of (magic word ID => replacement)
+        * This method uses the php feature to do several replacements at the same time,
+        * thereby gaining some efficiency. The result is placed in the out variable
+        * $result. The return value is true if something was replaced.
+        * @static 
+        **/
+       function replaceMultiple( $magicarr, $subject, &$result ){
                $search = array();
                $replace = array();
                foreach( $magicarr as $id => $replacement ){
@@ -246,7 +289,10 @@ class MagicWord {
                return !($result === $subject);
        }
 
-       # Adds all the synonyms of this MagicWord to an array, to allow quick lookup in a list of magic words
+       /**
+        * Adds all the synonyms of this MagicWord to an array, to allow quick
+        * lookup in a list of magic words
+        */
        function addToArray( &$array, $value ) {
                foreach ( $this->mSynonyms as $syn ) {
                        $array[$syn] = $value;
@@ -254,8 +300,11 @@ class MagicWord {
        }
 }
 
-# Used in matchAndRemove()
-/*private*/ function pregRemoveAndRecord( $match ) {
+/**
+ * Used in matchAndRemove()
+ * @private
+ **/
+function pregRemoveAndRecord( $match ) {
        global $wgMagicFound;
        $wgMagicFound = true;
        return '';
index f22226c..9b7a996 100644 (file)
@@ -1,12 +1,15 @@
 <?php
-#
-# Takes LaTeX fragments, sends them to a helper program (texvc) for rendering
-# to rasterized PNG and HTML and MathML approximations. An appropriate
-# rendering form is picked and returned.
-#
-# by Tomasz Wegrzanowski, with additions by Brion Vibber (2003, 2004)
-#
+/**
+ * Contain everything related to <math> </math> parsing
+ */
 
+/**
+ * Takes LaTeX fragments, sends them to a helper program (texvc) for rendering
+ * to rasterized PNG and HTML and MathML approximations. An appropriate
+ * rendering form is picked and returned.
+ * 
+ * by Tomasz Wegrzanowski, with additions by Brion Vibber (2003, 2004)
+ */
 class MathRenderer {
        var $mode = MW_MATH_MODERN;
        var $tex = '';
@@ -174,7 +177,9 @@ class MathRenderer {
                return false;
        }
 
-       # Select among PNG, HTML, or MathML output depending on 
+       /**
+        * Select among PNG, HTML, or MathML output depending on
+        */
        function _doRender() {
                if( $this->mode == MW_MATH_MATHML && $this->mathml != '' ) {
                        return "<math xmlns='http://www.w3.org/1998/Math/MathML'>{$this->mathml}</math>";
index 304cceb..289ea36 100644 (file)
@@ -1,30 +1,39 @@
 <?php
+/**
+ * This file gets included if $wgSessionsInMemcache is set in the config.
+ * It redirects session handling functions to store their data in memcached
+ * instead of the local filesystem. Depending on circumstances, it may also
+ * be necessary to change the cookie settings to work across hostnames.
+ * See: http://www.php.net/manual/en/function.session-set-save-handler.php
+ */
 
-/*
-       This file gets included if $wgSessionsInMemcache is set in the config.
-       It redirects session handling functions to store their data in memcached
-       instead of the local filesystem. Depending on circumstances, it may also
-       be necessary to change the cookie settings to work across hostnames.
-       
-       See: http://www.php.net/manual/en/function.session-set-save-handler.php
-*/
-
-
+/**
+ * @todo document
+ */
 function memsess_key( $id ) {
        global $wgDBname;
        return "$wgDBname:session:$id";
 }
 
+/**
+ * @todo document
+ */
 function memsess_open( $save_path, $session_name ) {
        # NOP, $wgMemc should be set up already
        return true;
 }
 
+/**
+ * @todo document
+ */
 function memsess_close() {
        # NOP
        return true;
 }
 
+/**
+ * @todo document
+ */
 function memsess_read( $id ) {
        global $wgMemc;
        $data = $wgMemc->get( memsess_key( $id ) );
@@ -32,18 +41,27 @@ function memsess_read( $id ) {
        return $data;
 }
 
+/**
+ * @todo document
+ */
 function memsess_write( $id, $data ) {
        global $wgMemc;
        $wgMemc->set( memsess_key( $id ), $data, 3600 );
        return true;
 }
 
+/**
+ * @todo document
+ */
 function memsess_destroy( $id ) {
        global $wgMemc;
        $wgMemc->delete( memsess_key( $id ) );
        return true;
 }
 
+/**
+ * @todo document
+ */
 function memsess_gc( $maxlifetime ) {
        # NOP: Memcached performs garbage collection.
        return true;
index 485b10e..8f480e6 100755 (executable)
@@ -1,12 +1,19 @@
 <?php
+/**
+ *
+ */
 
-# Message cache
-# Performs various useful MediaWiki namespace-related functions
-
+/**
+ *
+ */
 define( 'MSG_LOAD_TIMEOUT', 60);
 define( 'MSG_LOCK_TIMEOUT', 10);
 define( 'MSG_WAIT_TIMEOUT', 10);
 
+/**
+ * Message cache
+ * Performs various useful MediaWiki namespace-related functions
+ */
 class MessageCache
 {
        var $mCache, $mUseCache, $mDisable, $mExpiry;
@@ -37,9 +44,11 @@ class MessageCache
                wfProfileOut( $fname );
        }
 
-       # Loads messages either from memcached or the database, if not disabled
-       # On error, quietly switches to a fallback mode
-       # Returns false for a reportable error, true otherwise
+       /**
+        * Loads messages either from memcached or the database, if not disabled
+        * On error, quietly switches to a fallback mode
+        * Returns false for a reportable error, true otherwise
+        */
        function load() {
                global $wgAllMessagesEn;
                
@@ -103,9 +112,10 @@ class MessageCache
                return $success;
        }
 
-       # Loads all cacheable messages from the database
-       function loadFromDB()
-       {
+       /**
+        * Loads all cacheable messages from the database
+        */
+       function loadFromDB() {
                $fname = 'MessageCache::loadFromDB';
                $dbr =& wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'cur', 
@@ -122,7 +132,9 @@ class MessageCache
                $dbr->freeResult( $res );
        }
        
-       # Not really needed anymore
+       /**
+        * Not really needed anymore
+        */
        function getKeys() {
                global $wgAllMessagesEn, $wgLang;
                if ( !$this->mKeys ) {
@@ -134,7 +146,9 @@ class MessageCache
                return $this->mKeys;
        }
        
-       # Obsolete
+       /**
+        * Obsolete
+        */
        function isCacheable( $key ) {
                return true;
                /*
@@ -154,8 +168,10 @@ class MessageCache
                $this->unlock();
        }
 
-       # Returns success
-       # Represents a write lock on the messages key
+       /**
+        * Returns success
+        * Represents a write lock on the messages key
+        */
        function lock() {
                if ( !$this->mUseCache ) {
                        return true;
@@ -255,7 +271,9 @@ class MessageCache
                }
        }
        
-       # Clear all stored messages. Mainly used after a mass rebuild.
+       /**
+        * Clear all stored messages. Mainly used after a mass rebuild.
+        */
        function clear() {
                if( $this->mUseCache ) {
                        $this->mMemc->delete( $this->mMemcKey );
index bf1869b..edea045 100644 (file)
@@ -1,5 +1,6 @@
 <?php
-/* Metadata.php -- provides DublinCore and CreativeCommons metadata
+/**
+ * Metadata.php -- provides DublinCore and CreativeCommons metadata
  * Copyright 2004, Evan Prodromou <evan@wikitravel.org>.
  * 
  *  This program is free software; you can redistribute it and/or modify
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * @author Evan Prodromou <evan@wikitravel.org>
  */
 
+/**
+ *
+ */
 define('RDF_TYPE_PREFS', "application/rdf+xml,text/xml;q=0.7,application/xml;q=0.5,text/rdf;q=0.1");
 
 function wfDublinCoreRdf($article) {
@@ -60,7 +66,10 @@ function wfCreativeCommonsRdf($article) {
        ccEpilogue();
 }
 
-/* private */ function rdfSetup() {
+/**
+ * @private
+ */
+function rdfSetup() {
        global $wgOut, $wgRdfMimeType, $_SERVER;
        
        $rdftype = wfNegotiateType(wfAcceptToPrefs($_SERVER['HTTP_ACCEPT']), wfAcceptToPrefs(RDF_TYPE_PREFS));
@@ -76,7 +85,10 @@ function wfCreativeCommonsRdf($article) {
        }
 }
 
-/* private */ function dcPrologue($url) {
+/**
+ * @private
+ */
+function dcPrologue($url) {
        global $wgOutputEncoding;
        
        $url = htmlspecialchars( $url );
@@ -90,14 +102,20 @@ function wfCreativeCommonsRdf($article) {
 ";
 }
 
-/* private */ function dcEpilogue() {
+/**
+ * @private
+ */
+function dcEpilogue() {
        print "
   </rdf:Description>
 </rdf:RDF>
 ";
 }
 
-/* private */ function dcBasics($article) {
+/**
+ * @private
+ */
+function dcBasics($article) {
        global $wgLanguageCode, $wgSitename;
        
        dcElement('title', $article->mTitle->getText());
@@ -126,7 +144,10 @@ function wfCreativeCommonsRdf($article) {
        dcRights($article);
 }
 
-/* private */ function ccPrologue() {
+/**
+ * @private
+ */
+function ccPrologue() {
        global $wgOutputEncoding;
        
        echo "<" . "?xml version='1.0'  encoding='{$wgOutputEncoding}' ?" . ">
@@ -137,16 +158,25 @@ function wfCreativeCommonsRdf($article) {
 ";
 }  
 
-/* private */ function ccSubPrologue($type, $url) {
+/**
+ * @private
+ */
+function ccSubPrologue($type, $url) {
        $url = htmlspecialchars( $url );
        echo "  <cc:{$type} rdf:about=\"{$url}\">\n";
 }  
 
-/* private */ function ccSubEpilogue($type) {
+/**
+ * @private
+ */
+function ccSubEpilogue($type) {
        echo "  </cc:{$type}>\n";
 }  
 
-/* private */ function ccLicense($terms) {
+/**
+ * @private
+ */
+function ccLicense($terms) {
        
        foreach ($terms as $term) {
                switch ($term) {
@@ -170,30 +200,48 @@ function wfCreativeCommonsRdf($article) {
        }
 }
 
-/* private */ function ccTerm($term, $name) {
+/**
+ * @private
+ */
+function ccTerm($term, $name) {
        print "    <cc:{$term} rdf:resource=\"http://web.resource.org/cc/{$name}\" />\n";
 }
 
-/* private */ function ccEpilogue() {
+/**
+ * @private
+ */
+function ccEpilogue() {
        echo "</rdf:RDF>\n";
 }
 
-/* private */ function dcElement($name, $value) {
+/**
+ * @private
+ */
+function dcElement($name, $value) {
        $value = htmlspecialchars( $value );
        print "    <dc:{$name}>{$value}</dc:{$name}>\n";
 }
 
-/* private */ function dcDate($timestamp) {
+/**
+ * @private
+ */
+function dcDate($timestamp) {
        return substr($timestamp, 0, 4) . '-'
                . substr($timestamp, 4, 2) . '-'
                . substr($timestamp, 6, 2);
 }
 
-/* private */ function dcReallyFullUrl($title) {
+/**
+ * @private
+ */
+function dcReallyFullUrl($title) {
        return $title->getFullURL();
 }
 
-/* private */ function dcPageOrString($name, $page, $str) {
+/**
+ * @private
+ */
+function dcPageOrString($name, $page, $str) {
        $nt = Title::newFromText($page);
        
        if (!$nt || $nt->getArticleID() == 0) {
@@ -203,16 +251,25 @@ function wfCreativeCommonsRdf($article) {
        }
 }
 
-/* private */ function dcPage($name, $title) {
+/**
+ * @private
+ */
+function dcPage($name, $title) {
        dcUrl($name, dcReallyFullUrl($title));
 }
 
-/* private */ function dcUrl($name, $url) {
+/**
+ * @private
+ */
+function dcUrl($name, $url) {
        $url = htmlspecialchars( $url );
        print "    <dc:{$name} rdf:resource=\"{$url}\" />\n";
 }
 
-/* private */ function dcPerson($name, $id, $user_name='', $user_real_name='') {
+/**
+ * @private
+ */
+function dcPerson($name, $id, $user_name='', $user_real_name='') {
        global $wgLang;
 
        if ($id == 0) {
@@ -228,10 +285,12 @@ function wfCreativeCommonsRdf($article) {
        }
 }
 
-/* Takes an arg, for future enhancement with different rights for
- different pages. */
-
-/* private */ function dcRights($article) {
+/**
+ * Takes an arg, for future enhancement with different rights for
+ * different pages.
+ * @private
+ */
+function dcRights($article) {
        
        global $wgRightsPage, $wgRightsUrl, $wgRightsText;
        
@@ -246,7 +305,10 @@ function wfCreativeCommonsRdf($article) {
        }
 }
 
-/* private */ function ccGetTerms($url) {
+/**
+ * @private
+ */
+function ccGetTerms($url) {
        global $wgLicenseTerms;
        
        if (isset($wgLicenseTerms)) {
@@ -257,7 +319,10 @@ function wfCreativeCommonsRdf($article) {
        }
 }
 
-/* private */ function getKnownLicenses() {
+/**
+ * @private
+ */
+function getKnownLicenses() {
        
        $ccLicenses = array('by', 'by-nd', 'by-nd-nc', 'by-nc', 
                             'by-nc-sa', 'by-sa');
index b02542d..81c4a49 100644 (file)
@@ -1,18 +1,19 @@
 <?php
-
-# This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+/**
+ * Provide things related to namespaces
+ */
+/**
+ * This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+ */
 if( defined( 'MEDIAWIKI' ) ) {
 
-# This is a utility class with only static functions
-# for dealing with namespaces that encodes all the
-# "magic" behaviors of them based on index.  The textual
-# names of the namespaces are handled by Language.php.
-
-# Definitions of the NS_ constants are in Defines.php
-
-# These are synonyms for the names given in the language file
-# Users and translators should not change them
-/* private */ $wgCanonicalNamespaceNames = array(
+/**
+ * Definitions of the NS_ constants are in Defines.php
+ * @private
+ */
+$wgCanonicalNamespaceNames = array(
        NS_MEDIA            => 'Media',
        NS_SPECIAL          => 'Special',
        NS_TALK             => 'Talk',
@@ -36,26 +37,45 @@ if(isset($wgExtraNamespaces)) {
        $wgCanonicalNamespaceNames=$wgCanonicalNamespaceNames+$wgExtraNamespaces;
 }
 
+/**
+ * This is a utility class with only static functions
+ * for dealing with namespaces that encodes all the
+ * "magic" behaviors of them based on index.  The textual
+ * names of the namespaces are handled by Language.php.
+ *
+ * These are synonyms for the names given in the language file
+ * Users and translators should not change them
+*/
 class Namespace {
 
-       /* These functions are deprecated */
+       /**#@+
+        * These functions are deprecated
+        * @deprecated
+        */
        function getSpecial() { return NS_SPECIAL; }
        function getUser() { return NS_USER; }
        function getWikipedia() { return NS_PROJECT; }
        function getImage() { return NS_IMAGE; }
        function getMedia() { return NS_MEDIA; }
        function getCategory() { return NS_CATEGORY; }
+       /**#@-*/
 
-       function isMovable( $index )
-       {
+       /**
+        * Check if the given namespace might be moved
+        * @return bool
+        */
+       function isMovable( $index ) {
                if ( $index < NS_MAIN || $index == NS_IMAGE  || $index == NS_CATEGORY ) { 
                        return false; 
                }
                return true;
        }
 
-       function isTalk( $index )
-       {
+       /**
+        * Check if the give namespace is a talk page
+        * @return bool
+        */
+       function isTalk( $index ) {
                global $wgExtraNamespaces;
                return ( $index == NS_TALK           || $index == NS_USER_TALK     ||
                                 $index == NS_PROJECT_TALK   || $index == NS_IMAGE_TALK    ||
@@ -66,10 +86,10 @@ class Namespace {
                
        }
 
-       # Get the talk namespace corresponding to the given index
-       #
-       function getTalk( $index )
-       {
+       /**
+        * Get the talk namespace corresponding to the given index
+        */
+       function getTalk( $index ) {
                if ( Namespace::isTalk( $index ) ) {
                        return $index;
                } else {
@@ -78,8 +98,7 @@ class Namespace {
                }
        }
 
-       function getSubject( $index )
-       {
+       function getSubject( $index ) {
                if ( Namespace::isTalk( $index ) ) {
                        return $index - 1;
                } else {
@@ -87,17 +106,19 @@ class Namespace {
                }
        }
 
-       # Returns the canonical (English Wikipedia) name for a given index
-       function &getCanonicalName( $index )
-       {
+       /**
+        * Returns the canonical (English Wikipedia) name for a given index
+        */
+       function &getCanonicalName( $index ) {
                global $wgCanonicalNamespaceNames;
                return $wgCanonicalNamespaceNames[$index];
        }
 
-       # Returns the index for a given canonical name, or NULL
-       # The input *must* be converted to lower case first
-       function &getCanonicalIndex( $name )
-       {
+       /**
+        * Returns the index for a given canonical name, or NULL
+        * The input *must* be converted to lower case first
+        */
+       function &getCanonicalIndex( $name ) {
                global $wgCanonicalNamespaceNames;
                static $xNamespaces = false;
                if ( $xNamespaces === false ) {
index 101ae7f..fc74066 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
-
-# Simple generic object store
-# interface is intended to be more or less compatible with
-# the PHP memcached client.
-#
-# backends for local hash array and SQL table included:
-#  $bag = new HashBagOStuff();
-#  $bag = new MysqlBagOStuff($tablename); # connect to db first
-
-class /* abstract */ BagOStuff {
+/**
+ *
+ */
+/**
+ * Simple generic object store
+ *
+ * interface is intended to be more or less compatible with
+ * the PHP memcached client.
+ *
+ * backends for local hash array and SQL table included:
+ * $bag = new HashBagOStuff();
+ * $bag = new MysqlBagOStuff($tablename); # connect to db first
+ *
+ * @abstract
+ */
+class BagOStuff {
        var $debugmode;
        
        function BagOStuff() {
@@ -142,7 +149,10 @@ class /* abstract */ BagOStuff {
 }
 
 
-/* Functional versions! */
+/**
+ * Functional versions!
+ * @todo document
+ */
 class HashBagOStuff extends BagOStuff {
        /*
           This is a test of the interface, mainly. It stores
@@ -194,7 +204,12 @@ CREATE TABLE objectcache (
   key (exptime)
 );
 */
-class /* abstract */ SqlBagOStuff extends BagOStuff {
+
+/**
+ * @todo document
+ * @abstract
+ */
+class SqlBagOStuff extends BagOStuff {
        var $table;
 
        function SqlBagOStuff($tablename = 'objectcache') {
@@ -307,6 +322,9 @@ class /* abstract */ SqlBagOStuff extends BagOStuff {
        }
 }
 
+/**
+ * @todo document
+ */
 class MediaWikiBagOStuff extends SqlBagOStuff {
        var $tableInitialised = false;
 
@@ -346,6 +364,9 @@ class MediaWikiBagOStuff extends SqlBagOStuff {
        }
 }
 
+/**
+ * @todo document
+ */
 class TurckBagOStuff extends BagOStuff {
        function get($key) {
                return mmcache_get( $key );
index 6e3cc1b..8c561d6 100644 (file)
@@ -1,6 +1,11 @@
 <?php
+/**
+ *
+ */
 
-# This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+/**
+ * This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+ */
 if( defined( 'MEDIAWIKI' ) ) {
 
 # See design.doc
@@ -9,6 +14,9 @@ if($wgUseTeX) require_once( 'Math.php' );
 
 define( 'RLH_FOR_UPDATE', 1 );
 
+/**
+ * @todo document
+ */
 class OutputPage {
        var $mHeaders, $mCookies, $mMetatags, $mKeywords;
        var $mLinktags, $mPagetitle, $mBodytext, $mDebugtext;
@@ -68,10 +76,12 @@ class OutputPage {
                $haveMeta = true;
        }
 
-       # checkLastModified tells the client to use the client-cached page if
-       # possible. If sucessful, the OutputPage is disabled so that
-       # any future call to OutputPage->output() have no effect. The method
-       # returns true iff cache-ok headers was sent.
+       /**
+        * checkLastModified tells the client to use the client-cached page if
+        * possible. If sucessful, the OutputPage is disabled so that
+        * any future call to OutputPage->output() have no effect. The method
+        * returns true iff cache-ok headers was sent.
+        */
        function checkLastModified ( $timestamp )
        {
                global $wgLang, $wgCachePages, $wgUser;
@@ -218,8 +228,9 @@ class OutputPage {
                return wfSetVar( $this->mParserOptions, $options );
        }
 
-       # Convert wikitext to HTML and add it to the buffer
-       #
+       /**
+        * Convert wikitext to HTML and add it to the buffer
+        */
        function addWikiText( $text, $linestart = true )
        {
                global $wgParser, $wgTitle;
@@ -230,9 +241,10 @@ class OutputPage {
                $this->addHTML( $parserOutput->getText() );
        }
 
-       # Add wikitext to the buffer, assuming that this is the primary text for a page view
-       # Saves the text into the parser cache if possible
-       #
+       /**
+        * Add wikitext to the buffer, assuming that this is the primary text for a page view
+        * Saves the text into the parser cache if possible
+        */
        function addPrimaryWikiText( $text, $cacheArticle ) {
                global $wgParser, $wgParserCache, $wgUser, $wgTitle;
 
@@ -265,12 +277,16 @@ class OutputPage {
                }
        }
 
-       # Set the maximum cache time on the Squid in seconds
+       /**
+        * Set the maximum cache time on the Squid in seconds
+        */
        function setSquidMaxage( $maxage ) {
                $this->mSquidMaxage = $maxage;
        }
 
-       # Use enableClientCache(false) to force it to send nocache headers
+       /**
+        * Use enableClientCache(false) to force it to send nocache headers
+        */
        function enableClientCache( $state ) {
                return wfSetVar( $this->mEnableClientCache, $state );
        }
@@ -321,9 +337,10 @@ class OutputPage {
                }
        }
 
-       # Finally, all the text has been munged and accumulated into
-       # the object, let's actually output it:
-       #
+       /**
+        * Finally, all the text has been munged and accumulated into
+        * the object, let's actually output it:
+        */
        function output()
        {
                global $wgUser, $wgLang, $wgDebugComments, $wgCookieExpiration;
@@ -384,8 +401,7 @@ class OutputPage {
                # flush();
        }
 
-       function out( $ins )
-       {
+       function out( $ins ) {
                global $wgInputEncoding, $wgOutputEncoding, $wgLang;
                if ( 0 == strcmp( $wgInputEncoding, $wgOutputEncoding ) ) {
                        $outs = $ins;
@@ -396,8 +412,7 @@ class OutputPage {
                print $outs;
        }
 
-       function setEncodings()
-       {
+       function setEncodings() {
                global $wgInputEncoding, $wgOutputEncoding;
                global $wgUser, $wgLang;
 
@@ -444,10 +459,11 @@ class OutputPage {
                $wgOutputEncoding = $wgInputEncoding;
        }
 
-       # Returns a HTML comment with the elapsed time since request.
-       # This method has no side effects.
-       function reportTime()
-       {
+       /**
+        * Returns a HTML comment with the elapsed time since request.
+        * This method has no side effects.
+        */
+       function reportTime() {
                global $wgRequestTime;
 
                $now = wfTime();
@@ -473,10 +489,10 @@ class OutputPage {
                return $com;
        }
 
-       # Note: these arguments are keys into wfMsg(), not text!
-       #
-       function errorpage( $title, $msg )
-       {
+       /**
+        * Note: these arguments are keys into wfMsg(), not text!
+        */
+       function errorpage( $title, $msg ) {
                global $wgTitle;
 
                $this->mDebugtext .= 'Original title: ' .
@@ -496,8 +512,7 @@ class OutputPage {
                wfErrorExit();
        }
 
-       function sysopRequired()
-       {
+       function sysopRequired() {
                global $wgUser;
 
                $this->setPageTitle( wfMsg( 'sysoptitle' ) );
@@ -512,8 +527,7 @@ class OutputPage {
                $this->returnToMain();
        }
 
-       function developerRequired()
-       {
+       function developerRequired() {
                global $wgUser;
 
                $this->setPageTitle( wfMsg( 'developertitle' ) );
@@ -528,8 +542,7 @@ class OutputPage {
                $this->returnToMain();
        }
 
-       function loginToUse()
-       {
+       function loginToUse() {
                global $wgUser, $wgTitle, $wgLang;
 
                $this->setPageTitle( wfMsg( 'loginreqtitle' ) );
@@ -548,8 +561,7 @@ class OutputPage {
                $this->returnToMain();          # Flip back to the main page after 10 seconds.
        }
 
-       function databaseError( $fname, $sql, $error, $errno )
-       {
+       function databaseError( $fname, $sql, $error, $errno ) {
                global $wgUser, $wgCommandLineMode;
 
                $this->setPageTitle( wfMsgNoDB( 'databaseerror' ) );
@@ -575,8 +587,7 @@ class OutputPage {
                wfErrorExit();
        }
 
-       function readOnlyPage( $source = null, $protected = false )
-       {
+       function readOnlyPage( $source = null, $protected = false ) {
                global $wgUser, $wgReadOnlyFile;
 
                $this->setRobotpolicy( 'noindex,nofollow' );
@@ -605,8 +616,7 @@ class OutputPage {
                $this->returnToMain( false );
        }
 
-       function fatalError( $message )
-       {
+       function fatalError( $message ) {
                $this->setPageTitle( wfMsg( "internalerror" ) );
                $this->setRobotpolicy( "noindex,nofollow" );
                $this->setArticleRelated( false );
@@ -618,36 +628,32 @@ class OutputPage {
                wfErrorExit();
        }
 
-       function unexpectedValueError( $name, $val )
-       {
+       function unexpectedValueError( $name, $val ) {
                $this->fatalError( wfMsg( 'unexpected', $name, $val ) );
        }
 
-       function fileCopyError( $old, $new )
-       {
+       function fileCopyError( $old, $new ) {
                $this->fatalError( wfMsg( 'filecopyerror', $old, $new ) );
        }
 
-       function fileRenameError( $old, $new )
-       {
+       function fileRenameError( $old, $new ) {
                $this->fatalError( wfMsg( 'filerenameerror', $old, $new ) );
        }
 
-       function fileDeleteError( $name )
-       {
+       function fileDeleteError( $name ) {
                $this->fatalError( wfMsg( 'filedeleteerror', $name ) );
        }
 
-       function fileNotFoundError( $name )
-       {
+       function fileNotFoundError( $name ) {
                $this->fatalError( wfMsg( 'filenotfound', $name ) );
        }
 
-       // return from error messages or notes
-       //   auto:      automatically redirect the user after 10 seconds
-       //   returnto:  page title to return to. Default is Main Page.
-       function returnToMain( $auto = true, $returnto = NULL )
-       {
+       /**
+        * return from error messages or notes
+        * @param $auto automatically redirect the user after 10 seconds
+        * @param $returnto page title to return to. Default is Main Page.
+        */
+       function returnToMain( $auto = true, $returnto = NULL ) {
                global $wgUser, $wgOut, $wgRequest;
 
                if ( $returnto == NULL ) {
@@ -668,10 +674,11 @@ class OutputPage {
                $wgOut->addHTML( "\n<p>$r</p>\n" );
        }
 
-       # This function takes the existing and broken links for the page
-       # and uses the first 10 of them for META keywords
-       function addMetaTags ()
-       {
+       /**
+        * This function takes the existing and broken links for the page
+        * and uses the first 10 of them for META keywords
+        */
+       function addMetaTags () {
                global $wgLinkCache , $wgOut ;
                $good = array_keys ( $wgLinkCache->mGoodLinks ) ;
                $bad = array_keys ( $wgLinkCache->mBadLinks ) ;
@@ -687,8 +694,10 @@ class OutputPage {
                $wgOut->addMeta ( 'KEYWORDS' , $a ) ;
        }
 
-       /* private */ function headElement()
-       {
+       /**
+        * @private
+        */
+       function headElement() {
                global $wgDocType, $wgDTD, $wgLanguageCode, $wgOutputEncoding, $wgMimeType;
                global $wgUser, $wgLang, $wgRequest;
 
@@ -777,19 +786,22 @@ class OutputPage {
                return $ret;
        }
        
-       # Run any necessary pre-output transformations on the buffer text
-       function transformBuffer( $options = 0 )
-       {
+       /**
+        * Run any necessary pre-output transformations on the buffer text
+        */
+       function transformBuffer( $options = 0 ) {
                $this->replaceLinkHolders( $this->mBodytext, $options );
        }
 
-       # Replace <!--LINK--> link placeholders with actual links, in the buffer
-       # Placeholders created in Skin::makeLinkObj()
-       # Returns an array of links found, indexed by PDBK:
-       #   0 - broken
-       #   1 - normal link
-       #   2 - stub
-       # $options is a bit field, RLH_FOR_UPDATE to select for update
+       /**
+        * Replace <!--LINK--> link placeholders with actual links, in the buffer
+        * Placeholders created in Skin::makeLinkObj()
+        * Returns an array of links found, indexed by PDBK:
+        *  0 - broken
+        *  1 - normal link
+        *  2 - stub
+        * $options is a bit field, RLH_FOR_UPDATE to select for update
+        */
        function replaceLinkHolders( &$text, $options = 0 ) {
                global $wgUser, $wgLinkCache, $wgUseOldExistenceCheck;
                
index 2c3d445..bc01ce4 100644 (file)
@@ -1,9 +1,13 @@
 <?php
-
-/* Page history
-   Split off from Article.php and Skin.php, 2003-12-22
-*/
-
+/**
+ * Page history
+ * 
+ * Split off from Article.php and Skin.php, 2003-12-22
+ */
+
+/**
+ * @todo document
+ */
 class PageHistory {
        var $mArticle, $mTitle, $mSkin;
        var $lastline, $lastdate;
@@ -15,8 +19,7 @@ class PageHistory {
 
        # This shares a lot of issues (and code) with Recent Changes
 
-       function history()
-       {
+       function history() {
                global $wgUser, $wgOut, $wgLang;
 
                # If page hasn't changed, client can cache this
@@ -116,8 +119,7 @@ class PageHistory {
                wfProfileOut( $fname );
        }
 
-       function beginHistoryList()
-       {
+       function beginHistoryList() {
                global $wgTitle;
                $this->lastdate = $this->lastline = '';
                $s = '<p>' . wfMsg( 'histlegend' ) . '</p>';
@@ -129,8 +131,7 @@ class PageHistory {
                return $s;
        }
 
-       function endHistoryList( $skip = false )
-       {
+       function endHistoryList( $skip = false ) {
                $last = wfMsg( 'last' );
 
                $s = $skip ? '' : preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline );
@@ -140,8 +141,7 @@ class PageHistory {
                return $s;
        }
 
-       function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor, $counter = '' )
-       {
+       function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor, $counter = '' ) {
                global $wgLang;
 
                $artname = Title::makeName( $ns, $ttl );
index 4f3dae6..14436b9 100644 (file)
@@ -2,36 +2,40 @@
 
 // require_once('Tokenizer.php');
 
-# PHP Parser
-#
-# Processes wiki markup
-#
-# There are two main entry points into the Parser class:
-# parse()
-#   produces HTML output
-# preSaveTransform().
-#   produces altered wiki markup.
-#
-# Globals used:
-#    objects:   $wgLang, $wgDateFormatter, $wgLinkCache, $wgCurParser
-#
-# NOT $wgArticle, $wgUser or $wgTitle. Keep them away!
-#
-# settings:
-#   $wgUseTex*, $wgUseDynamicDates*, $wgInterwikiMagic*,
-#   $wgNamespacesWithSubpages, $wgLanguageCode, $wgAllowExternalImages*,
-#   $wgLocaltimezone
-#
-#   * only within ParserOptions
-#
-#----------------------------------------
-#    Variable substitution O(N^2) attack
-#-----------------------------------------
-# Without countermeasures, it would be possible to attack the parser by saving
-# a page filled with a large number of inclusions of large pages. The size of
-# the generated page would be proportional to the square of the input size.
-# Hence, we limit the number of inclusions of any given page, thus bringing any
-# attack back to O(N).
+/**
+ * PHP Parser
+ * 
+ * Processes wiki markup
+ *
+ * There are two main entry points into the Parser class:
+ * parse()
+ *   produces HTML output
+ * preSaveTransform().
+ *   produces altered wiki markup.
+ *
+ * Globals used:
+ *    objects:   $wgLang, $wgDateFormatter, $wgLinkCache, $wgCurParser
+ *
+ * NOT $wgArticle, $wgUser or $wgTitle. Keep them away!
+ *
+ * settings:
+ *  $wgUseTex*, $wgUseDynamicDates*, $wgInterwikiMagic*,
+ *  $wgNamespacesWithSubpages, $wgLanguageCode, $wgAllowExternalImages*,
+ *  $wgLocaltimezone
+ *
+ *  * only within ParserOptions
+ *
+ */
+
+/**
+ * Variable substitution O(N^2) attack
+ *
+* Without countermeasures, it would be possible to attack the parser by saving
+* a page filled with a large number of inclusions of large pages. The size of
+* the generated page would be proportional to the square of the input size.
+* Hence, we limit the number of inclusions of any given page, thus bringing any
+* attack back to O(N).
+*/
 define( 'MAX_INCLUDE_REPEAT', 100 );
 define( 'MAX_INCLUDE_SIZE', 1000000 ); // 1 Million
 
@@ -66,6 +70,9 @@ define( 'EXT_IMAGE_REGEX',
        '('.EXT_IMAGE_FNAME_CLASS.'+)\\.((?i)'.EXT_IMAGE_EXTENSIONS.')$/S' # Filename
 );
 
+/**
+ * @todo document
+ */
 class Parser
 {
        # Persistent:
@@ -2321,6 +2328,9 @@ class Parser
        }
 }
 
+/**
+ * @todo document
+ */
 class ParserOutput
 {
        var $mText, $mLanguageLinks, $mCategoryLinks, $mContainsOldMagic;
@@ -2355,6 +2365,10 @@ class ParserOutput
 
 }
 
+/**
+ * Set options of the Parser
+ * @todo document
+ */
 class ParserOptions
 {
        # All variables are private
@@ -2446,7 +2460,9 @@ function wfVariableSubstitution( $matches ) {
        return $wgCurParser->variableSubstitution( $matches );
 }
 
-# Return the total number of articles
+/**
+ * Return the total number of articles
+ */
 function wfNumberOfArticles() {
        global $wgNumberOfArticles;
 
@@ -2454,8 +2470,11 @@ function wfNumberOfArticles() {
        return $wgNumberOfArticles;
 }
 
-# Get various statistics from the database
-/* private */ function wfLoadSiteStats() {
+/**
+ * Get various statistics from the database
+ * @private
+ */
+function wfLoadSiteStats() {
        global $wgNumberOfArticles, $wgTotalViews, $wgTotalEdits;
        $fname = 'wfLoadSiteStats';
 
index 2d2f4e0..59522e4 100644 (file)
@@ -1,5 +1,11 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 class ParserCache
 {
        function getKey( &$article, &$user ) {
index c91fe14..e4cf4c2 100644 (file)
@@ -1,8 +1,12 @@
 <?
-# This should one day become the XML->(X)HTML parser
-# Based on work by Jan Hidders and Magnus Manske
+/**
+ * This should one day become the XML->(X)HTML parser
+ * Based on work by Jan Hidders and Magnus Manske
+ */
 
-//  the base class for an element
+/**
+ * the base class for an element
+ */
 class element {
   var $name = '';
   var $attrs = array();
@@ -68,7 +72,10 @@ function wgXMLcharacterData($parser, $data) {
 }
 
 
-# Here's the class that generates a nice tree
+/**
+ * Here's the class that generates a nice tree
+ * package parserxml
+ */
 class xml2php {
 
    function &scanFile( $filename ) {
index 5c5f3de..163c4bc 100755 (executable)
@@ -1,13 +1,20 @@
 <?php
-# This file is only included if profiling is enabled
-function wfProfileIn( $functionname )
-{
+/**
+ * This file is only included if profiling is enabled
+ */
+
+/**
+ * @param $functioname name of the function we will profile
+ */
+function wfProfileIn( $functionname ) {
        global $wgProfiler;
        $wgProfiler->profileIn( $functionname );
 }
 
-function wfProfileOut( $functionname = 'missing' ) 
-{
+/**
+ * @param $functioname name of the function we have profiled
+ */
+function wfProfileOut( $functionname = 'missing' ) {
        global $wgProfiler;
        $wgProfiler->profileOut( $functionname );
 }
@@ -17,8 +24,7 @@ function wfGetProfilingOutput( $start, $elapsed ) {
        return $wgProfiler->getOutput( $start, $elapsed );
 }
 
-function wfProfileClose()
-{
+function wfProfileClose() {
        global $wgProfiler;
        $wgProfiler->close();
 }
@@ -30,6 +36,9 @@ if( !function_exists( 'memory_get_usage' ) ) {
        }
 }
 
+/**
+ * @todo document
+ */
 class Profiler
 {
        var $mStack = array(), $mWorkStack = array(), $mCollated = array();
@@ -43,8 +52,7 @@ class Profiler
        }
        */
        
-       function profileIn( $functionname )
-       {
+       function profileIn( $functionname ) {
                global $wgDebugFunctionEntry;
                if ( $wgDebugFunctionEntry && function_exists( 'wfDebug' ) ) {
                        wfDebug( str_repeat( ' ', count( $this->mWorkStack ) ) . 'Entering '.$functionname."\n" );
@@ -52,8 +60,7 @@ class Profiler
                array_push( $this->mWorkStack, array($functionname, count( $this->mWorkStack ), microtime(), memory_get_usage() ) );
        }
 
-       function profileOut( $functionname )
-       {
+       function profileOut( $functionname ) {
                $memory = memory_get_usage();
                global $wgDebugProfiling, $wgDebugFunctionEntry;
 
@@ -79,15 +86,13 @@ class Profiler
                }
        }
        
-       function close() 
-       {
+       function close() {
                while ( count( $this->mWorkStack ) ) {
                        $this->profileOut( 'close' );
                }
        }
 
-       function getOutput()
-       {
+       function getOutput() {
                global $wgDebugFunctionEntry;
                $wgDebugFunctionEntry = false;
 
@@ -165,8 +170,10 @@ class Profiler
        }
 
 
-       /* static */ function logToDB($name, $timeSum, $eventCount) 
-       {
+       /**
+        * @static
+        */
+       function logToDB($name, $timeSum, $eventCount) {
                $dbw =& wfGetDB( DB_MASTER );
                $profiling = $dbw->tableName( 'profiling' );
 
index ce602fe..5b1df4b 100644 (file)
@@ -1,38 +1,52 @@
 <?php
+/**
+ * Contain a class for special pages
+ */
 
+/**
+ *
+ */
 require_once ( 'Feed.php' );
 
-# This is a class for doing query pages; since they're almost all the same,
-# we factor out some of the functionality into a superclass, and let
-# subclasses derive from it.
-
+/**
+ * This is a class for doing query pages; since they're almost all the same,
+ * we factor out some of the functionality into a superclass, and let
+ * subclasses derive from it.
+ *
+ */
 class QueryPage {
-       # Subclasses return their name here. Make sure the name is also
-       # specified in SpecialPage.php and in Language.php as a language message param.
-
+       
+       /**
+        * Subclasses return their name here. Make sure the name is also
+        * specified in SpecialPage.php and in Language.php as a language message
+        * param.
+        */
        function getName() {
                return '';
        }
 
-       # Subclasses return an SQL query here.
-       #
-       # Note that the query itself should return the following four columns:
-       # 'type' (your special page's name), 'namespace', 'title', and 'value'
-       # *in that order*. 'value' is used for sorting.
-       #
-       # These may be stored in the querycache table for expensive queries,
-       # and that cached data will be returned sometimes, so the presence of
-       # extra fields can't be relied upon. The cached 'value' column will be
-       # an integer; non-numeric values are useful only for sorting the initial
-       # query.
-       #
-       # Don't include an ORDER or LIMIT clause, this will be added.
-
+       /**
+        * Subclasses return an SQL query here.
+        * 
+        * Note that the query itself should return the following four columns:
+        * 'type' (your special page's name), 'namespace', 'title', and 'value'
+        * *in that order*. 'value' is used for sorting.
+        *
+        * These may be stored in the querycache table for expensive queries,
+        * and that cached data will be returned sometimes, so the presence of
+        * extra fields can't be relied upon. The cached 'value' column will be
+        * an integer; non-numeric values are useful only for sorting the initial
+        * query.
+        *
+        * Don't include an ORDER or LIMIT clause, this will be added.
+        */
        function getSQL() {
                return "SELECT 'sample' as type, 0 as namespace, 'Sample result' as title, 42 as value";
        }
 
-       # Override to sort by increasing values
+       /**
+        * Override to sort by increasing values
+        */
        function sortDescending() {
                return true;
        }
@@ -42,31 +56,39 @@ class QueryPage {
                        ($this->sortDescending() ? 'DESC' : '');
        }
 
-       # Is this query expensive (for some definition of expensive)? Then we
-       # don't let it run in miser mode. $wgDisableQueryPages causes all query
-       # pages to be declared expensive. Some query pages are always expensive.
+       /**
+        * Is this query expensive (for some definition of expensive)? Then we
+        * don't let it run in miser mode. $wgDisableQueryPages causes all query
+        * pages to be declared expensive. Some query pages are always expensive.
+        */
        function isExpensive( ) {
                global $wgDisableQueryPages;
                return $wgDisableQueryPages;
        }
 
-       # Formats the results of the query for display. The skin is the current
-       # skin; you can use it for making links. The result is a single row of
-       # result data. You should be able to grab SQL results off of it.
-
+       /**
+        * Formats the results of the query for display. The skin is the current
+        * skin; you can use it for making links. The result is a single row of
+        * result data. You should be able to grab SQL results off of it.
+        */
        function formatResult( $skin, $result ) {
                return '';
        }
                
-       # The content returned by this function will be output before any result
-       
+       /**
+        * The content returned by this function will be output before any result
+       */
        function getPageHeader( ) {
                return '';
        }
 
-       # This is the actual workhorse. It does everything needed to make a
-       # real, honest-to-gosh query page.
-
+       /**
+        * This is the actual workhorse. It does everything needed to make a
+        * real, honest-to-gosh query page.
+        *
+        * @param $offset database query offset
+        * @param $limit database query limit
+        */
        function doQuery( $offset, $limit ) {
                global $wgUser, $wgOut, $wgLang, $wgRequest;
                global $wgMiserMode;
@@ -163,7 +185,9 @@ class QueryPage {
                $wgOut->addHTML( "<p>{$sl}</p>\n" );
        }
 
-       # Similar to above, but packaging in a syndicated feed instead of a web page
+       /**
+        * Similar to above, but packaging in a syndicated feed instead of a web page
+        */
        function doFeed( $class = '' ) {
                global $wgFeedClasses;
                global $wgOut, $wgLanguageCode, $wgLang;
@@ -190,7 +214,10 @@ class QueryPage {
                }
        }
 
-       # Override for custom handling. If the titles/links are ok, just do feedItemDesc()
+       /**
+        * Override for custom handling. If the titles/links are ok, just do
+        * feedItemDesc()
+        */
        function feedResult( $row ) {
                if( !isset( $row->title ) ) {
                        return NULL;
@@ -262,10 +289,11 @@ class QueryPage {
        }
 }
 
-# This is a subclass for very simple queries that are just looking for page
-# titles that match some criteria. It formats each result item as a link to
-# that page.
-
+/**
+ * This is a subclass for very simple queries that are just looking for page
+ * titles that match some criteria. It formats each result item as a link to
+ * that page.
+ */
 class PageQueryPage extends QueryPage {
 
        function formatResult( $skin, $result ) {
index 4a8c936..17a9ee4 100644 (file)
@@ -1,10 +1,17 @@
 <?php
-# Copyright (C) 2004 Gabriel Wicke <gw@wikidev.net>
-# http://www.aulinx.de/
-# Based on PageHistory and SpecialExport
-# 
-# License: GPL (http://www.gnu.org/copyleft/gpl.html)
+/**
+ * Copyright (C) 2004 Gabriel Wicke <gw@wikidev.net>
+ * http://www.aulinx.de/
+ * Based on PageHistory and SpecialExport
+ * 
+ * License: GPL (http://www.gnu.org/copyleft/gpl.html)
+ *
+ * @author Gabriel Wicke <gw@wikidev.net>
+ */
 
+/**
+ * @todo document
+ */
 class RawPage {
 
        function RawPage( $article ) {
@@ -40,6 +47,7 @@ class RawPage {
                        $this->mContentType = $ctype;
                }
        }
+       
        function view() {
                global $wgUser, $wgOut;
                header( "Content-type: ".$this->mContentType.'; charset='.$this->mCharset );
index 11931c5..e7d1625 100644 (file)
@@ -1,6 +1,11 @@
 <?php
-# Utility class for creating new RC entries
+/**
+ *
+ */
 
+/**
+ * Various globals
+ */
 define( 'RC_EDIT', 0);
 define( 'RC_NEW', 1);
 define( 'RC_MOVE', 2);
@@ -8,32 +13,34 @@ define( 'RC_LOG', 3);
 define( 'RC_MOVE_OVER_REDIRECT', 4);
 
 
-/*
-mAttributes:
-       rc_id           id of the row in the recentchanges table
-       rc_timestamp    time the entry was made
-       rc_cur_time     timestamp on the cur row
-       rc_namespace    namespace #
-       rc_title        non-prefixed db key
-       rc_type         is new entry, used to determine whether updating is necessary
-       rc_minor        is minor
-       rc_cur_id       id of associated cur entry
-       rc_user         user id who made the entry
-       rc_user_text    user name who made the entry
-       rc_comment      edit summary
-       rc_this_oldid   old_id associated with this entry (or zero)
-       rc_last_oldid   old_id associated with the entry before this one (or zero)
-       rc_bot          is bot, hidden
-       rc_ip           IP address of the user in dotted quad notation
-       rc_new          obsolete, use rc_type==RC_NEW
-       rc_patrolled    boolean whether or not someone has marked this edit as patrolled
-
-mExtra:
-       prefixedDBkey   prefixed db key, used by external app via msg queue
-       lastTimestamp   timestamp of previous entry, used in WHERE clause during update
-       lang            the interwiki prefix, automatically set in save()
-*/
-
+/**
+ * Utility class for creating new RC entries
+ * mAttributes:
+ *     rc_id           id of the row in the recentchanges table
+ *     rc_timestamp    time the entry was made
+ *     rc_cur_time     timestamp on the cur row
+ *     rc_namespace    namespace #
+ *     rc_title        non-prefixed db key
+ *     rc_type         is new entry, used to determine whether updating is necessary
+ *     rc_minor        is minor
+ *     rc_cur_id       id of associated cur entry
+ *     rc_user         user id who made the entry
+ *     rc_user_text    user name who made the entry
+ *     rc_comment      edit summary
+ *     rc_this_oldid   old_id associated with this entry (or zero)
+ *     rc_last_oldid   old_id associated with the entry before this one (or zero)
+ *     rc_bot          is bot, hidden
+ *     rc_ip           IP address of the user in dotted quad notation
+ *     rc_new          obsolete, use rc_type==RC_NEW
+ *     rc_patrolled    boolean whether or not someone has marked this edit as patrolled
+ * 
+ * mExtra:
+ *     prefixedDBkey   prefixed db key, used by external app via msg queue
+ *     lastTimestamp   timestamp of previous entry, used in WHERE clause during update
+ *     lang            the interwiki prefix, automatically set in save()
+ * 
+ * @todo document functions and variables
+ */
 class RecentChange
 {
        var $mAttribs = array(), $mExtra = array();
@@ -357,8 +364,10 @@ class RecentChange
        }
 
 
-       # Gets the end part of the diff URL assoicated with this object
-       # Blank if no diff link should be displayed
+       /**
+        * Gets the end part of the diff URL assoicated with this object
+        * Blank if no diff link should be displayed
+        */
        function diffLinkTrail( $forceCur )
        {
                if ( $this->mAttribs['rc_type'] == RC_EDIT ) {
index 1f37fe4..2b8d29f 100644 (file)
@@ -1,9 +1,18 @@
 <?php
-# See search.doc
-
+/**
+ * Contain site class
+ * See search.doc
+ */
+
+/**
+ *
+ */
 define( 'MW_SEARCH_OK', true );
 define( 'MW_SEARCH_BAD_QUERY', false );
 
+/**
+ * @todo document
+ */
 class SearchEngine {
        /* private */ var $rawText, $filteredText, $searchTerms;
        /* private */ var $titleCond, $textCond;
@@ -31,7 +40,9 @@ class SearchEngine {
                $this->db =& wfGetDB( DB_SLAVE );
        }
 
-       # Return a partial WHERE clause to limit the search to the given namespaces
+       /**
+        * Return a partial WHERE clause to limit the search to the given namespaces
+        */
        function queryNamespaces() {
                $namespaces = implode( ',', $this->namespacesToSearch );
                if ($namespaces == '') {
@@ -40,7 +51,9 @@ class SearchEngine {
                return "AND cur_namespace IN (" . $namespaces . ')';
        }
 
-       # Return a partial WHERE clause to include or exclude redirects from results
+       /**
+        * Return a partial WHERE clause to include or exclude redirects from results
+        */
        function searchRedirects() {
                if ( $this->doSearchRedirects ) {
                        return '';
@@ -49,8 +62,9 @@ class SearchEngine {
                }
        }
 
-       /* private */ function initNamespaceCheckbox( $i )
-       {
+       /**
+        * @access private
+        */ function initNamespaceCheckbox( $i ) {
                global $wgUser, $wgNamespacesToBeSearchedDefault;
                
                if ($wgUser->getID()) {
@@ -62,8 +76,10 @@ class SearchEngine {
                }
        }
 
-       # Display the "power search" footer. Does not actually perform the search, 
-       # that is done by showResults()
+       /**
+        * Display the "power search" footer. Does not actually perform the search, 
+        * that is done by showResults()
+        */
        function powersearch() {
                global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest;
                $sk =& $wgUser->getSkin();
@@ -158,7 +174,9 @@ class SearchEngine {
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
        }
 
-       # Perform the search and construct the results page
+       /**
+        * Perform the search and construct the results page
+        */
        function showResults() {
                global $wgUser, $wgTitle, $wgOut, $wgLang;
                global $wgDisableTextSearch, $wgInputEncoding;
@@ -500,7 +518,10 @@ class SearchEngine {
                }
        }
 
-       /* static */ function doFuzzyTitleSearch( $search, $namespace ){
+       /**
+        * @static
+        */
+       function doFuzzyTitleSearch( $search, $namespace ){
                global $wgLang, $wgOut;
                
                $this->setupPage();
@@ -531,7 +552,10 @@ class SearchEngine {
                return false;
        }
 
-       /* static */ function fuzzyTitles( $sstr, $namespace = NS_MAIN ){
+       /**
+        * @static
+        */
+       function fuzzyTitles( $sstr, $namespace = NS_MAIN ){
                $span = 0.10; // weed on title length before doing levenshtein.
                $tolerance = 0.35; // allowed percentage of erronous characters
                $slen = strlen($sstr);
@@ -556,7 +580,10 @@ class SearchEngine {
                return $result;
        }
 
-       /* static */ function getTitlesByLength($aLength, $aNamespace = 0){
+       /**
+        * static
+        */
+       function getTitlesByLength($aLength, $aNamespace = 0){
                global $wgMemc, $wgDBname;
                $fname = 'SearchEngin::getTitlesByLength';
                
@@ -604,6 +631,10 @@ class SearchEngine {
        }
 }
 
-/* private static */ function SearchEngine_pcmp($a, $b){ return $a[0] - $b[0]; }
+/**
+ * @access private
+ * @static
+ */
+function SearchEngine_pcmp($a, $b){ return $a[0] - $b[0]; }
 
 ?>
index c6563a0..6a59fba 100644 (file)
@@ -1,14 +1,18 @@
 <?php
 # $Id$
-# See deferred.doc
+/**
+ * See deferred.doc
+ */
 
+/**
+ *
+ */
 class SearchUpdate {
 
        /* private */ var $mId = 0, $mNamespace, $mTitle, $mText;
        /* private */ var $mTitleWords;
 
-       function SearchUpdate( $id, $title, $text = false )
-       {
+       function SearchUpdate( $id, $title, $text = false ) {
                $nt = Title::newFromText( $title );
                if( $nt ) {
                        $this->mId = $id;
@@ -23,8 +27,7 @@ class SearchUpdate {
                }
        }
 
-       function doUpdate()
-       {
+       function doUpdate() {
                global $wgDBminWordLen, $wgLang, $wgDisableSearchUpdate;
 
                if( $wgDisableSearchUpdate || !$this->mId ) {
index 701a022..881c017 100644 (file)
@@ -1,6 +1,12 @@
 <?php
-
-# This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+/**
+ * Include most things that's need to customize the site
+ */
+
+/**
+ * This file is not a valid entry point, perform no further processing unless
+ * MEDIAWIKI is defined
+ */
 if( defined( 'MEDIAWIKI' ) ) {
 
 # The main wiki script and things like database
@@ -111,6 +117,10 @@ if( $wgUseMemCached ) {
        # Set up Memcached
        #
        require_once( 'memcached-client.php' );
+       
+       /**
+        *
+        */
        class MemCachedClientforWiki extends memcached {
                function _debugprint( $text ) {
                        wfDebug( "memcached: $text\n" );
@@ -129,8 +139,9 @@ if( $wgUseMemCached ) {
        $wgMemc = new TurckBagOStuff;
        $messageMemc = &$wgMemc;
 } else {
-       # No shared memory
-       #
+       /**
+        * No shared memory
+        */
        class FakeMemCachedClient {
                function add ($key, $val, $exp = 0) { return true; }
                function decr ($key, $amt=1) { return null; }
index abdcec0..88b1a6e 100644 (file)
@@ -1,9 +1,13 @@
 <?php
+/**
+ *This file is used to configure the live Wikimedia wikis. The file that
+ * includes it contains passwords and other sensitive data, and there's
+ * currently no public equivalent.
+ */
 
-# This file is used to configure the live Wikimedia wikis. The file that includes
-# it contains passwords and other sensitive data, and there's currently no public
-# equivalent. 
-
+/**
+ *
+ */
 class SiteConfiguration {
        var $suffixes, $wikis, $settings;
        var $localDatabases;
@@ -60,7 +64,10 @@ class SiteConfiguration {
                }
        }
 
-       # Work out the site and language name from a database name
+       /**
+        * Work out the site and language name from a database name
+        * @param $db
+        */
        function siteFromDB( $db ) {
                $site = NULL;
                $lang = NULL;
index 536908d..468540a 100644 (file)
@@ -1,20 +1,23 @@
 <?php
 # $Id$
-# See deferred.doc
+/**
+ * See deferred.doc
+ */
 
+/**
+ *
+ */
 class SiteStatsUpdate {
 
        var $mViews, $mEdits, $mGood;
 
-       function SiteStatsUpdate( $views, $edits, $good )
-       {
+       function SiteStatsUpdate( $views, $edits, $good ) {
                $this->mViews = $views;
                $this->mEdits = $edits;
                $this->mGood = $good;
        }
 
-       function doUpdate()
-       {
+       function doUpdate() {
                $a = array();
 
                if ( $this->mViews < 0 ) { $m = '-1'; }
index 9b9f9c2..28fa550 100644 (file)
@@ -1,6 +1,12 @@
 <?php
 
-# This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+/**
+ *
+ */
+
+/**
+ * This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+ */
 if( defined( "MEDIAWIKI" ) ) {
 
 # See skin.doc
@@ -48,6 +54,9 @@ unset($matches);
 
 require_once( 'RecentChange.php' );
 
+/**
+ * @todo document
+ */
 class RCCacheEntry extends RecentChange
 {
        var $secureName, $link;
@@ -64,18 +73,22 @@ class RCCacheEntry extends RecentChange
 } ;
 
 
-# The main skin class that provide methods and properties for all other skins
-# including PHPTal skins.
-# This base class is also the "Standard" skin.
-
+/**
+ * The main skin class that provide methods and properties for all other skins
+ * including PHPTal skins.
+ * This base class is also the "Standard" skin.
+ */
 class Skin {
-
-       /* private */ var $lastdate, $lastline;
+       /**#@+
+        * @access private
+        */
+       var $lastdate, $lastline;
        var $linktrail ; # linktrail regexp
        var $rc_cache ; # Cache for Enhanced Recent Changes
        var $rcCacheIndex ; # Recent Changes Cache Counter for visibility toggle
        var $rcMoveIndex;
        var $postParseLinkColour = true;
+       /**#@-*/
 
        function Skin() {
                global $wgUseOldExistenceCheck;
@@ -96,7 +109,9 @@ class Skin {
                return 'standard';
        }
 
-       # Get/set accessor for delayed link colouring
+       /**
+        * Get/set accessor for delayed link colouring
+        */
        function postParseLinkColour( $setting = NULL ) {
                return wfSetVar( $this->postParseLinkColour, $setting );
        }
@@ -216,10 +231,14 @@ class Skin {
                return $s."\n";
        }
        
-       # placeholder, returns generated js in monobook
+       /**
+        * placeholder, returns generated js in monobook
+        */
        function getUserJs() { return; }
 
-       # Return html code that include User stylesheets
+       /**
+        * Return html code that include User stylesheets
+        */
        function getUserStyles() {
                global $wgOut, $wgStylePath, $wgLang;
                $s = "<style type='text/css'>\n";
@@ -230,7 +249,9 @@ class Skin {
                return $s;
        }
 
-       # Some styles that are set by user through the user settings interface.
+       /**
+        * Some styles that are set by user through the user settings interface.
+        */
        function doGetUserStyles() {
                global $wgUser, $wgLang;
 
@@ -253,8 +274,7 @@ class Skin {
                return $s;
        }
 
-       function getBodyOptions()
-       {
+       function getBodyOptions() {
                global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $wgRequest;
 
                extract( $wgRequest->getValues( 'oldid', 'redirect', 'diff' ) );
@@ -282,8 +302,7 @@ class Skin {
                return $a;
        }
 
-       function getExternalLinkAttributes( $link, $text, $class='' )
-       {
+       function getExternalLinkAttributes( $link, $text, $class='' ) {
                global $wgUser, $wgOut, $wgLang;
 
                $link = urldecode( $link );
@@ -299,8 +318,7 @@ class Skin {
                return $r;
        }
 
-       function getInternalLinkAttributes( $link, $text, $broken = false )
-       {
+       function getInternalLinkAttributes( $link, $text, $broken = false ) {
                global $wgUser, $wgOut;
 
                $link = urldecode( $link );
@@ -321,8 +339,10 @@ class Skin {
                return $r;
        }
 
-       function getInternalLinkAttributesObj( &$nt, $text, $broken = false )
-       {
+       /**
+        * @param bool $broken
+        */
+       function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) {
                global $wgUser, $wgOut;
 
                if ( $broken == 'stub' ) {
@@ -339,24 +359,25 @@ class Skin {
                return $r;
        }
 
-       # URL to the logo
+       /**
+        * URL to the logo
+        */
        function getLogo() {
                global $wgLogo;
                return $wgLogo;
        }
 
-       # This will be called immediately after the <body> tag.  Split into
-       # two functions to make it easier to subclass.
-       #
-       function beforeContent()
-       {
+       /**
+        * This will be called immediately after the <body> tag.  Split into
+        * two functions to make it easier to subclass.
+        */
+       function beforeContent() {
                global $wgUser, $wgOut;
 
                return $this->doBeforeContent();
        }
 
-       function doBeforeContent()
-       {
+       function doBeforeContent() {
                global $wgUser, $wgOut, $wgTitle, $wgLang, $wgSiteNotice;
                $fname = 'Skin::doBeforeContent';
                wfProfileIn( $fname );
@@ -1414,16 +1435,19 @@ class Skin {
                return $s;
        }
 
-       # After all the page content is transformed into HTML, it makes
-       # a final pass through here for things like table backgrounds.
-       #
+       /**
+        * After all the page content is transformed into HTML, it makes
+        * a final pass through here for things like table backgrounds.
+        * @todo probably deprecated [AV]
+        */
        function transformContent( $text ) {
                return $text;
        }
 
-       # Note: This function MUST call getArticleID() on the link,
-       # otherwise the cache won't get updated properly.  See LINKCACHE.DOC.
-       #
+       /**
+        * Note: This function MUST call getArticleID() on the link,
+        * otherwise the cache won't get updated properly.  See LINKCACHE.DOC.
+        */
        function makeLink( $title, $text = '', $query = '', $trail = '' ) {
                wfProfileIn( 'Skin::makeLink' );
                $nt = Title::newFromText( $title );
@@ -1468,7 +1492,9 @@ class Skin {
                }
        }
 
-       # Pass a title object, not a title string
+       /**
+        * Pass a title object, not a title string
+        */
        function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
                global $wgOut, $wgUser;
                $fname = 'Skin::makeLinkObj';
@@ -1543,7 +1569,9 @@ class Skin {
                return $retVal;
        }
 
-       # Pass a title object, not a title string
+       /**
+        * Pass a title object, not a title string
+        */
        function makeKnownLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '' ) {
                global $wgOut, $wgTitle, $wgInputEncoding;
 
@@ -1590,7 +1618,9 @@ class Skin {
                return $r;
        }
 
-       # Pass a title object, not a title string
+       /**
+        * Pass a title object, not a title string
+        */
        function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
                global $wgOut, $wgUser;
 
@@ -1630,7 +1660,9 @@ class Skin {
                return $s;
        }
 
-       # Pass a title object, not a title string
+       /**
+        * Pass a title object, not a title string
+        */
        function makeStubLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
                global $wgOut, $wgUser;
 
@@ -1904,8 +1936,10 @@ class Skin {
                return str_replace("\n", ' ',$prefix.$s.$postfix);
        }
 
-       # Make HTML for a thumbnail including image, border and caption
-       # $img is an Image object
+       /**
+        * Make HTML for a thumbnail including image, border and caption
+        * $img is an Image object
+        */
        function makeThumbLinkObj( $img, $label = '', $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) {
                global $wgStylePath, $wgLang;
                # $image = Title::makeTitleSafe( NS_IMAGE, $name );
@@ -2050,8 +2084,10 @@ class Skin {
                return $s;
        }
 
-       # Returns text for the end of RC
-       # If enhanced RC is in use, returns pretty much all the text
+       /**
+        * Returns text for the end of RC
+        * If enhanced RC is in use, returns pretty much all the text
+        */
        function endRecentChangesList() {
                $s = $this->recentChangesBlock() ;
                if( $this->rclistOpen ) {
@@ -2060,7 +2096,9 @@ class Skin {
                return $s;
        }
 
-       # Enhanced RC ungrouped line
+       /**
+        * Enhanced RC ungrouped line
+        */
        function recentChangesBlockLine ( $rcObj ) {
                global $wgStylePath, $wgLang ;
 
@@ -2124,7 +2162,9 @@ class Skin {
                return $r ;
        }
 
-       # Enhanced RC group
+       /**
+        * Enhanced RC group
+        */
        function recentChangesBlockGroup ( $block ) {
                global $wgStylePath, $wgLang ;
 
@@ -2241,8 +2281,10 @@ class Skin {
                return $r ;
        }
 
-       # If enhanced RC is in use, this function takes the previously cached
-       # RC lines, arranges them, and outputs the HTML
+       /**
+        * If enhanced RC is in use, this function takes the previously cached
+        * RC lines, arranges them, and outputs the HTML
+        */
        function recentChangesBlock () {
                global $wgStylePath ;
                if ( count ( $this->rc_cache ) == 0 ) return '' ;
@@ -2258,8 +2300,10 @@ class Skin {
                return '<div>'.$blockOut.'</div>' ;
        }
 
-       # Called in a loop over all displayed RC entries
-       # Either returns the line, or caches it for later use
+       /**
+        * Called in a loop over all displayed RC entries
+        * Either returns the line, or caches it for later use
+        */
        function recentChangesLine( &$rc, $watched = false ) {
                global $wgUser ;
                $usenew = $wgUser->getOption( 'usenewrc' );
@@ -2503,18 +2547,20 @@ class Skin {
                return $s;
        }
 
-       /* This function is called by all recent changes variants, by the page history,
-          and by the user contributions list. It is responsible for formatting edit
-          comments. It escapes any HTML in the comment, but adds some CSS to format
-          auto-generated comments (from section editing) and formats [[wikilinks]].
-          
-          The &$title parameter must be a title OBJECT. It is used to generate a 
-          direct link to the section in the autocomment.
-          Main author: Erik Moeller (moeller@scireview.de)
-       */
-       # Note: there's not always a title to pass to this function.
-       # Since you can't set a default parameter for a reference, I've turned it
-       # temporarily to a value pass. Should be adjusted further. --brion
+       /**
+        * This function is called by all recent changes variants, by the page history,
+        * and by the user contributions list. It is responsible for formatting edit
+        * comments. It escapes any HTML in the comment, but adds some CSS to format
+        * auto-generated comments (from section editing) and formats [[wikilinks]].
+        *
+        * The &$title parameter must be a title OBJECT. It is used to generate a 
+        * direct link to the section in the autocomment.
+        * @author Erik Moeller <moeller@scireview.de>
+        * 
+        * Note: there's not always a title to pass to this function.
+        * Since you can't set a default parameter for a reference, I've turned it
+        * temporarily to a value pass. Should be adjusted further. --brion
+        */
        function formatComment($comment, $title = NULL) {
                global $wgLang;
                $comment = htmlspecialchars( $comment );
@@ -2640,7 +2686,9 @@ class Skin {
                return str_repeat( "</div>\n", $level>0 ? $level : 0 );
        }
 
-       # parameter level defines if we are on an indentation level
+       /**
+        * parameter level defines if we are on an indentation level
+        */
        function tocLine( $anchor, $tocline, $level ) {
                $link = '<a href="#'.$anchor.'">'.$tocline.'</a><br />';
                if($level) {
@@ -2663,7 +2711,10 @@ class Skin {
                $toc."</td></tr></table>\n";
        }
 
-       # These two do not check for permissions: check $wgTitle->userCanEdit before calling them
+       /**
+        * These two do not check for permissions: check $wgTitle->userCanEdit
+        * before calling them
+        */
        function editSectionScript( $section, $head ) {
                global $wgTitle, $wgRequest;
                if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {
@@ -2698,21 +2749,26 @@ class Skin {
 
        }
 
-       // This function is called by EditPage.php and shows a bulletin board style
-       // toolbar for common editing functions. It can be disabled in the user preferences.
-       // The necsesary JavaScript code can be found in style/wikibits.js.
+       /**
+        * This function is called by EditPage.php and shows a bulletin board style
+        * toolbar for common editing functions. It can be disabled in the user
+        * preferences.
+        * The necsesary JavaScript code can be found in style/wikibits.js.
+        */
        function getEditToolbar() {
                global $wgStylePath, $wgLang, $wgMimeType;
 
-               // toolarray an array of arrays which each include the filename of
-               // the button image (without path), the opening tag, the closing tag,
-               // and optionally a sample text that is inserted between the two when no
-               // selection is highlighted.
-               // The tip text is shown when the user moves the mouse over the button.
-
-               // Already here are accesskeys (key), which are not used yet until someone
-               // can figure out a way to make them work in IE. However, we should make
-               // sure these keys are not defined on the edit page.
+               /**
+                * toolarray an array of arrays which each include the filename of
+                * the button image (without path), the opening tag, the closing tag,
+                * and optionally a sample text that is inserted between the two when no
+                * selection is highlighted.
+                * The tip text is shown when the user moves the mouse over the button.
+                *
+                * Already here are accesskeys (key), which are not used yet until someone
+                * can figure out a way to make them work in IE. However, we should make
+                * sure these keys are not defined on the edit page.
+                */
                $toolarray=array(
                        array(  'image'=>'button_bold.png',
                                        'open'  =>      "\'\'\'",
@@ -2820,7 +2876,10 @@ class Skin {
                return $toolbar;
        }
 
-       /* public */ function suppressUrlExpansion() {
+       /**
+        * @access public
+        */
+       function suppressUrlExpansion() {
                return false;
        }
 }
index 4282a95..5a961a7 100644 (file)
@@ -1,16 +1,4 @@
 <?php
-# Generic PHPTal (http://phptal.sourceforge.net/) skin
-# Based on Brion's smarty skin
-# Copyright (C) Gabriel Wicke -- http://www.aulinx.de/
-#
-# Todo: Needs some serious refactoring into functions that correspond
-# to the computations individual esi snippets need. Most importantly no body
-# parsing for most of those of course.
-#
-# Set this in LocalSettings to enable phptal:
-# set_include_path(get_include_path() . ":" . $IP.'/PHPTAL-NP-0.7.0/libs');
-# $wgUsePHPTal = true;
-#
 # 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
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
-
-# This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+/**
+ * Generic PHPTal (http://phptal.sourceforge.net/) skin
+ * Based on Brion's smarty skin
+ * Copyright (C) Gabriel Wicke -- http://www.aulinx.de/
+ *
+ * Todo: Needs some serious refactoring into functions that correspond
+ * to the computations individual esi snippets need. Most importantly no body
+ * parsing for most of those of course.
+ * 
+ * Set this in LocalSettings to enable phptal:
+ * set_include_path(get_include_path() . ":" . $IP.'/PHPTAL-NP-0.7.0/libs');
+ * $wgUsePHPTal = true;
+ *
+ */
+
+/**
+ * This is not a valid entry point, perform no further processing unless
+ * MEDIAWIKI is defined
+ */
 if( defined( 'MEDIAWIKI' ) ) {
 
 require_once 'GlobalFunctions.php';
 global $IP;
 require_once $IP.'/PHPTAL-NP-0.7.0/libs/PHPTAL.php';
 
+/**
+ *
+ */
 class MediaWiki_I18N extends PHPTAL_I18N {
        var $_context = array();
 
@@ -55,6 +63,9 @@ class MediaWiki_I18N extends PHPTAL_I18N {
        }
 }
 
+/**
+ *
+ */
 class SkinPHPTal extends Skin {
        var $template;
 
@@ -64,7 +75,9 @@ class SkinPHPTal extends Skin {
                $this->template = 'MonoBook';
        }
 
-       # initialize various variables and generate the template
+       /**
+        * initialize various variables and generate the template
+        */
        function outputPage( &$out ) {
                global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
                global $wgScript, $wgStylePath, $wgLanguageCode, $wgUseNewInterlanguage;
@@ -248,7 +261,9 @@ class SkinPHPTal extends Skin {
 
        }
 
-       # build array of urls for personal toolbar
+       /**
+        * build array of urls for personal toolbar
+        */
        function buildPersonalUrls() {
                /* set up the default links for the personal toolbar */
                global $wgShowIPinHeader;
@@ -310,7 +325,9 @@ class SkinPHPTal extends Skin {
                return $personal_urls;
        }
 
-       # an array of edit links by default used for the tabs
+       /**
+        * an array of edit links by default used for the tabs
+        */
        function buildContentActionUrls () {
                global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
                $action = $wgRequest->getText( 'action' );
@@ -465,7 +482,9 @@ class SkinPHPTal extends Skin {
                return $content_actions;
        }
 
-       # build array of common navigation links
+       /**
+        * build array of common navigation links
+        */
        function buildNavUrls () {
                global $wgTitle, $wgUser, $wgRequest;
                global $wgSiteSupportPage, $wgDisableUploads;
@@ -516,7 +535,9 @@ class SkinPHPTal extends Skin {
                return $nav_urls;
        }
 
-       # Generate strings used for xml 'id' names
+       /**
+        * Generate strings used for xml 'id' names
+        */
        function getNameSpaceKey () {
                global $wgTitle;
                switch ($wgTitle->getNamespace()) {
@@ -554,7 +575,10 @@ class SkinPHPTal extends Skin {
        }
        
 
-       /* private */ function setupUserCssJs () {
+       /**
+        * @access private
+        */
+       function setupUserCssJs () {
                global $wgRequest, $wgTitle;
                $action = $wgRequest->getText('action');
                # generated css
@@ -582,7 +606,9 @@ class SkinPHPTal extends Skin {
                }
        }
        
-       # returns css with user-specific options
+       /**
+        * returns css with user-specific options
+        */
        function getUserStylesheet() {
                global $wgUser, $wgRequest, $wgTitle, $wgLang, $wgSquidMaxage, $wgStylePath;
                $action = $wgRequest->getText('action');
@@ -607,6 +633,9 @@ class SkinPHPTal extends Skin {
                return $s;
        }
        
+       /**
+        *
+        */
        function getUserJs() {
                global $wgUser, $wgStylePath;
                $s = '/* generated javascript */';
index 1a787bc..50f9719 100644 (file)
 <?php
+/**
+ * Provide functions to generate a special page
+ */
 
-       function wfSpecialAllmessages()
-       {
-               global $wgOut, $wgAllMessagesEn, $wgRequest, $wgMessageCache, $wgTitle;
-               
-               $fname = "wfSpecialAllMessages";
-               wfProfileIn( $fname );
-               
-               wfProfileIn( "$fname-setup");
-               $ot = $wgRequest->getText( 'ot' );
-               $mwMsg =& MagicWord::get( MAG_MSG );
-               
-               $navText = wfMsg( 'allmessagestext', $mwMsg->getSynonym( 0 ) );
-               $first = true;
-               $sortedArray = $wgAllMessagesEn;
-               ksort( $sortedArray );
-               $messages = array();
-               $wgMessageCache->disableTransform();
-               foreach ( $sortedArray as $key => $enMsg ) {
-                       $messages[$key]['enmsg'] = $enMsg;
-                       $messages[$key]['statmsg'] = wfMsgNoDb( $key );
-                       $messages[$key]['msg'] = wfMsg ( $key );
-               }
-               wfProfileOut( "$fname-setup" );
-               
-               wfProfileIn( "$fname-output" );
-               if ($ot == 'php') {
-                       $navText .= makePhp($messages);
-                       $wgOut->addHTML('PHP | <a href="'.$wgTitle->escapeLocalUrl('ot=html').'">HTML</a><pre>'.htmlspecialchars($navText).'</pre>');
-               } else {
-                       $wgOut->addHTML( '<a href="'.$wgTitle->escapeLocalUrl('ot=php').'">PHP</a> | HTML' );
-                       $wgOut->addWikiText( $navText );
-                       $wgOut->addHTML( makeHTMLText( $messages ) );
-               }
-               wfProfileOut( "$fname-output" );
-               
-               wfProfileOut( $fname );
+/**
+ *
+ */
+function wfSpecialAllmessages() {
+       global $wgOut, $wgAllMessagesEn, $wgRequest, $wgMessageCache, $wgTitle;
+       
+       $fname = "wfSpecialAllMessages";
+       wfProfileIn( $fname );
+       
+       wfProfileIn( "$fname-setup");
+       $ot = $wgRequest->getText( 'ot' );
+       $mwMsg =& MagicWord::get( MAG_MSG );
+       
+       $navText = wfMsg( 'allmessagestext', $mwMsg->getSynonym( 0 ) );
+       $first = true;
+       $sortedArray = $wgAllMessagesEn;
+       ksort( $sortedArray );
+       $messages = array();
+       $wgMessageCache->disableTransform();
+       foreach ( $sortedArray as $key => $enMsg ) {
+               $messages[$key]['enmsg'] = $enMsg;
+               $messages[$key]['statmsg'] = wfMsgNoDb( $key );
+               $messages[$key]['msg'] = wfMsg ( $key );
+       }
+       wfProfileOut( "$fname-setup" );
+       
+       wfProfileIn( "$fname-output" );
+       if ($ot == 'php') {
+               $navText .= makePhp($messages);
+               $wgOut->addHTML('PHP | <a href="'.$wgTitle->escapeLocalUrl('ot=html').'">HTML</a><pre>'.htmlspecialchars($navText).'</pre>');
+       } else {
+               $wgOut->addHTML( '<a href="'.$wgTitle->escapeLocalUrl('ot=php').'">PHP</a> | HTML' );
+               $wgOut->addWikiText( $navText );
+               $wgOut->addHTML( makeHTMLText( $messages ) );
        }
+       wfProfileOut( "$fname-output" );
        
-       function makePhp($messages) {
-               global $wgLanguageCode;
-               $txt = "\n\n".'$wgAllMessages'.ucfirst($wgLanguageCode).' = array('."\n";
-               foreach( $messages as $key => $m ) {
-                       if(strtolower($wgLanguageCode) != 'en' and $m['msg'] == $m['enmsg'] ) {
-                               if (strstr($m['msg'],"\n")) {
-                                       $txt.='/* ';
-                                       $comment=' */';
-                               } else {
-                                       $txt .= '#';
-                                       $comment = '';
-                               }
-                       } elseif ($m['msg'] == '&lt;'.$key.'&gt;'){
-                               $m['msg'] = '';
-                               $comment = ' #empty';
+       wfProfileOut( $fname );
+}
+
+/**
+ *
+ */
+function makePhp($messages) {
+       global $wgLanguageCode;
+       $txt = "\n\n".'$wgAllMessages'.ucfirst($wgLanguageCode).' = array('."\n";
+       foreach( $messages as $key => $m ) {
+               if(strtolower($wgLanguageCode) != 'en' and $m['msg'] == $m['enmsg'] ) {
+                       if (strstr($m['msg'],"\n")) {
+                               $txt.='/* ';
+                               $comment=' */';
                        } else {
+                               $txt .= '#';
                                $comment = '';
                        }
-                       $txt .= "'".$key."' => \"".str_replace('"','\"',$m['msg'])."\",$comment\n";
+               } elseif ($m['msg'] == '&lt;'.$key.'&gt;'){
+                       $m['msg'] = '';
+                       $comment = ' #empty';
+               } else {
+                       $comment = '';
                }
-               $txt .= ');';
-               return $txt;
+               $txt .= "'".$key."' => \"".str_replace('"','\"',$m['msg'])."\",$comment\n";
        }
+       $txt .= ');';
+       return $txt;
+}
 
-       function makeHTMLText( $messages ) {
-               global $wgLang, $wgUser;
-               $fname = "makeHTMLText";
-               wfProfileIn( $fname );
-               
-               $sk =& $wgUser->getSkin();
-               $talk = $wgLang->getNsText( NS_TALK );
-               $mwnspace = $wgLang->getNsText( NS_MEDIAWIKI );
-               $mwtalk = $wgLang->getNsText( NS_MEDIAWIKI_TALK );
-               $txt = "
+/**
+ *
+ */
+function makeHTMLText( $messages ) {
+       global $wgLang, $wgUser;
+       $fname = "makeHTMLText";
+       wfProfileIn( $fname );
+       
+       $sk =& $wgUser->getSkin();
+       $talk = $wgLang->getNsText( NS_TALK );
+       $mwnspace = $wgLang->getNsText( NS_MEDIAWIKI );
+       $mwtalk = $wgLang->getNsText( NS_MEDIAWIKI_TALK );
+       $txt = "
 
-               <table border='1' cellspacing='0' width='100%'>
-               <tr bgcolor='#b2b2ff'>
-                       <th>Name</th>
-                       <th>Default text</th>
-                       <th>Current text</th>
-               </tr>";
-               
-               wfProfileIn( "$fname-check" );
-               # This is a nasty hack to avoid doing independent existence checks
-               # without sending the links and table through the slow wiki parser.
-               $pageExists = array(
-                       NS_MEDIAWIKI => array(),
-                       NS_MEDIAWIKI_TALK => array()
-               );
-               $sql = "SELECT cur_namespace,cur_title FROM cur WHERE cur_namespace IN (" . NS_MEDIAWIKI . ", " . NS_MEDIAWIKI_TALK . ")";
-               $dbr =& wfGetDB( DB_SLAVE );
-               $res = $dbr->query( $sql );
-               while( $s = $dbr->fetchObject( $res ) ) {
-                       $pageExists[$s->cur_namespace][$s->cur_title] = true;
-               }
-               $dbr->freeResult( $res );
-               wfProfileOut( "$fname-check" );
+       <table border='1' cellspacing='0' width='100%'>
+       <tr bgcolor='#b2b2ff'>
+               <th>Name</th>
+               <th>Default text</th>
+               <th>Current text</th>
+       </tr>";
+       
+       wfProfileIn( "$fname-check" );
+       # This is a nasty hack to avoid doing independent existence checks
+       # without sending the links and table through the slow wiki parser.
+       $pageExists = array(
+               NS_MEDIAWIKI => array(),
+               NS_MEDIAWIKI_TALK => array()
+       );
+       $sql = "SELECT cur_namespace,cur_title FROM cur WHERE cur_namespace IN (" . NS_MEDIAWIKI . ", " . NS_MEDIAWIKI_TALK . ")";
+       $dbr =& wfGetDB( DB_SLAVE );
+       $res = $dbr->query( $sql );
+       while( $s = $dbr->fetchObject( $res ) ) {
+               $pageExists[$s->cur_namespace][$s->cur_title] = true;
+       }
+       $dbr->freeResult( $res );
+       wfProfileOut( "$fname-check" );
 
-               wfProfileIn( "$fname-output" );
-               foreach( $messages as $key => $m ) {
-                       $title = $wgLang->ucfirst( $key );
-                       $titleObj =& Title::makeTitle( NS_MEDIAWIKI, $title );
-                       $talkPage =& Title::makeTitle( NS_MEDIAWIKI_TALK, $title );
+       wfProfileIn( "$fname-output" );
+       foreach( $messages as $key => $m ) {
+               $title = $wgLang->ucfirst( $key );
+               $titleObj =& Title::makeTitle( NS_MEDIAWIKI, $title );
+               $talkPage =& Title::makeTitle( NS_MEDIAWIKI_TALK, $title );
 
-                       $colorIt = ($m['statmsg'] == $m['msg']) ? " bgcolor=\"#f0f0ff\"" : " bgcolor=\"#ffe2e2\"";
-                       $message = htmlspecialchars( $m['statmsg'] );
-                       $mw = htmlspecialchars( $m['msg'] );
-                       
-                       #$pageLink = $sk->makeLinkObj( $titleObj, htmlspecialchars( $key ) );
-                       #$talkLink = $sk->makeLinkObj( $talkPage, htmlspecialchars( $talk ) );
-                       if( isset( $pageExists[NS_MEDIAWIKI][$title] ) ) {
-                               $pageLink = $sk->makeKnownLinkObj( $titleObj, htmlspecialchars( $key ) );
-                       } else {
-                               $pageLink = $sk->makeBrokenLinkObj( $titleObj, htmlspecialchars( $key ) );
-                       }
-                       if( isset( $pageExists[NS_MEDIAWIKI_TALK][$title] ) ) {
-                               $talkLink = $sk->makeKnownLinkObj( $talkPage, htmlspecialchars( $talk ) );
-                       } else {
-                               $talkLink = $sk->makeBrokenLinkObj( $talkPage, htmlspecialchars( $talk ) );
-                       }
-
-                       $txt .= 
-                       "<tr$colorIt><td>
-                       $pageLink<br />
-                       $talkLink
-                       </td><td>
-                       $message
-                       </td><td>
-                       $mw
-                       </td></tr>";
+               $colorIt = ($m['statmsg'] == $m['msg']) ? " bgcolor=\"#f0f0ff\"" : " bgcolor=\"#ffe2e2\"";
+               $message = htmlspecialchars( $m['statmsg'] );
+               $mw = htmlspecialchars( $m['msg'] );
+               
+               #$pageLink = $sk->makeLinkObj( $titleObj, htmlspecialchars( $key ) );
+               #$talkLink = $sk->makeLinkObj( $talkPage, htmlspecialchars( $talk ) );
+               if( isset( $pageExists[NS_MEDIAWIKI][$title] ) ) {
+                       $pageLink = $sk->makeKnownLinkObj( $titleObj, htmlspecialchars( $key ) );
+               } else {
+                       $pageLink = $sk->makeBrokenLinkObj( $titleObj, htmlspecialchars( $key ) );
+               }
+               if( isset( $pageExists[NS_MEDIAWIKI_TALK][$title] ) ) {
+                       $talkLink = $sk->makeKnownLinkObj( $talkPage, htmlspecialchars( $talk ) );
+               } else {
+                       $talkLink = $sk->makeBrokenLinkObj( $talkPage, htmlspecialchars( $talk ) );
                }
-               $txt .= "</table>";
-               wfProfileOut( "$fname-output" );
 
-               wfProfileOut( $fname );
-               return $txt;
+               $txt .= 
+               "<tr$colorIt><td>
+               $pageLink<br />
+               $talkLink
+               </td><td>
+               $message
+               </td><td>
+               $mw
+               </td></tr>";
        }
+       $txt .= "</table>";
+       wfProfileOut( "$fname-output" );
+
+       wfProfileOut( $fname );
+       return $txt;
+}
 
 ?>
index 1853c2e..4ab53c0 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialAllpages( $par=NULL )
-{
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialAllpages( $par=NULL ) {
        global $indexMaxperpage, $toplevelMaxperpage, $wgRequest, $wgOut, $wgLang;
        $indexMaxperpage = 480;
        $toplevelMaxperpage = 50;
@@ -23,8 +28,7 @@ function wfSpecialAllpages( $par=NULL )
        }
 }
 
-function namespaceForm ( $namespace = 0, $from = "" )
-{
+function namespaceForm ( $namespace = 0, $from = '' ) {
        global $wgLang, $wgScript;
 
        $t = Title::makeTitle( NS_SPECIAL, "Allpages" );
@@ -50,8 +54,7 @@ function namespaceForm ( $namespace = 0, $from = "" )
        return $out;
 }
 
-function indexShowToplevel ( $namespace = 0 )
-{
+function indexShowToplevel ( $namespace = 0 ) {
        global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgLang, $wgRequest, $wgUser;
        $sk = $wgUser->getSkin();
        $fname = "indexShowToplevel";
@@ -152,8 +155,7 @@ function indexShowToplevel ( $namespace = 0 )
        $wgOut->addHtml( $out2 . $out );
 }
 
-function indexShowline( $inpoint, $outpoint, $namespace = 0 )
-{
+function indexShowline( $inpoint, $outpoint, $namespace = 0 ) {
        global $wgOut, $wgLang, $wgUser;
        $sk = $wgUser->getSkin();
        $dbr =& wfGetDB( DB_SLAVE );
@@ -172,8 +174,7 @@ function indexShowline( $inpoint, $outpoint, $namespace = 0 )
        return '<tr><td align="right">'.$out.'</td></tr>';
 }
 
-function indexShowChunk( $from, $namespace = 0 )
-{
+function indexShowChunk( $from, $namespace = 0 ) {
        global $wgOut, $wgUser, $indexMaxperpage, $wgLang;
        $sk = $wgUser->getSkin();
        $maxPlusOne = $indexMaxperpage + 1;
index 6029f06..24d8458 100644 (file)
@@ -1,7 +1,16 @@
 <?php
-
-require_once( "QueryPage.php" );
-
+/**
+ *
+ */
+
+/**
+ *
+ */
+require_once( 'QueryPage.php' );
+
+/**
+ *
+ */
 class AncientPagesPage extends QueryPage {
 
        function getName() {
@@ -38,8 +47,7 @@ class AncientPagesPage extends QueryPage {
        }
 }
 
-function wfSpecialAncientpages()
-{
+function wfSpecialAncientpages() {
        list( $limit, $offset ) = wfCheckLimits();
 
        $app = new AncientPagesPage();
index 63fefb1..d61424b 100644 (file)
@@ -1,13 +1,17 @@
 <?php
-#
-# If enabled through $wgAllowSysopQueries = true, this class
-# let users with sysop right the possibility to make sql queries
-# against the cur table.
-# Heavy queries could slow down the database specially for the
-# biggest wikis.
-
-function wfSpecialAsksql()
-{
+/**
+ * If enabled through $wgAllowSysopQueries = true, this class
+ * let users with sysop right the possibility to make sql queries
+ * against the cur table.
+ * Heavy queries could slow down the database specially for the
+ * biggest wikis.
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialAsksql() {
        global $wgUser, $wgOut, $wgRequest, $wgAllowSysopQueries;
 
        if( !$wgAllowSysopQueries ) {
@@ -31,19 +35,21 @@ function wfSpecialAsksql()
        if ( "submit" == $action ) {
                $f->doSubmit();
        } else {
-               $f->showForm( "" );
+               $f->showForm( '' );
        }
 }
 
+/**
+ * @access private
+ */
 class SqlQueryForm {
-       var $query = "";
+       var $query = '';
        
        function SqlQueryForm( $query ) {
                $this->query = $query;
        }
                
-       function showForm( $err )
-       {
+       function showForm( $err ) {
                global $wgOut, $wgUser, $wgLang;
                global $wgLogQueries;
 
@@ -79,8 +85,7 @@ class SqlQueryForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgServer, $wgScript, $wgArticlePath, $wgLang;
                global $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname, $wgSqlTimeout;
 
index 42f11eb..098309d 100644 (file)
@@ -1,7 +1,13 @@
 <?php
-
-function wfSpecialBlockip()
-{
+/**
+ * Constructor for Special:Blockip page
+ *
+ */
+
+/**
+ * Constructor
+ */
+function wfSpecialBlockip() {
        global $wgUser, $wgOut, $wgRequest;
 
        if ( ! $wgUser->isSysop() ) {
@@ -16,6 +22,10 @@ function wfSpecialBlockip()
        else { $ipb->showForm( "" ); }
 }
 
+/**
+ * Form object
+ *
+ */
 class IPBlockForm {
        var $BlockAddress, $BlockExpiry, $BlockReason;
 
@@ -86,8 +96,7 @@ class IPBlockForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgLang;
                global $wgSysopUserBans, $wgSysopRangeBans;
                
@@ -161,8 +170,7 @@ class IPBlockForm {
                $wgOut->redirect( $titleObj->getFullURL( "action=success&ip={$this->BlockAddress}" ) );
        }
 
-       function showSuccess()
-       {
+       function showSuccess() {
                global $wgOut, $wgUser;
 
                $wgOut->setPagetitle( wfMsg( "blockip" ) );
index fd547bb..ea45bc7 100644 (file)
@@ -1,4 +1,11 @@
 <?php
+/**
+ *
+ */
+
+/**
+ *
+ */
 function wfSpecialBlockme()
 {
        global $wgIP, $wgBlockOpenProxies, $wgOut, $wgProxyKey;
index 90262b8..cbc7a43 100644 (file)
@@ -1,10 +1,15 @@
 <?php
+/**
+ * ISBNs in wiki pages will create links to this page, with the ISBN passed
+ * in via the query string.
+ *
+ *
+ */
 
-# ISBNs in wiki pages will create links to this page, with
-# the ISBN passed in via the query string.
-
-function wfSpecialBooksources( $par )
-{
+/**
+ * Constructor
+ */
+function wfSpecialBooksources( $par ) {
        global $wgRequest;
        
        $isbn = $par;
@@ -17,6 +22,9 @@ function wfSpecialBooksources( $par )
        $bsl->show();
 }
 
+/**
+ *
+ */
 class BookSourceList {
        var $mIsbn;
 
index 42bba16..55a676e 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once('QueryPage.php');
 
+/**
+ *
+ */
 class BrokenRedirectsPage extends PageQueryPage {
 
        function getName() {
@@ -40,6 +49,9 @@ class BrokenRedirectsPage extends PageQueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialBrokenRedirects() {
        list( $limit, $offset ) = wfCheckLimits();
        
index 4e06560..b9a01fa 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once("QueryPage.php");
 
+/**
+ *
+ */
 class CategoriesPage extends QueryPage {
 
        function getName() {
@@ -34,8 +43,10 @@ class CategoriesPage extends QueryPage {
        }
 }
 
-function wfSpecialCategories()
-{
+/**
+ *
+ */
+function wfSpecialCategories() {
        list( $limit, $offset ) = wfCheckLimits();
 
        $cap = new CategoriesPage();
index 78bd35c..1be61ba 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialContributions( $par = "" )
-{
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialContributions( $par = '' ) {
        global $wgUser, $wgOut, $wgLang, $wgRequest;
        $fname = "wfSpecialContributions";
        $sysop = $wgUser->isSysop();
@@ -159,26 +164,23 @@ function wfSpecialContributions( $par = "" )
 }
 
 
-/*
-
-Generates each row in the contributions list.
-
-Contributions which are marked "top" are currently on top of the history.
-For these contributions, a [rollback] link is shown for users with sysop
-privileges. The rollback link restores the most recent version that was not
-written by the target user.
-
-If the contributions page is called with the parameter &bot=1, all rollback
-links also get that parameter. It causes the edit itself and the rollback
-to be marked as "bot" edits. Bot edits are hidden by default from recent
-changes, so this allows sysops to combat a busy vandal without bothering
-other users.
-
-TODO: This would probably look a lot nicer in a table.
-
-*/
-function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew, $target, $oldid )
-{
+/**
+ * Generates each row in the contributions list.
+ *
+ * Contributions which are marked "top" are currently on top of the history.
+ * For these contributions, a [rollback] link is shown for users with sysop
+ * privileges. The rollback link restores the most recent version that was not
+ * written by the target user.
+ * 
+ * If the contributions page is called with the parameter &bot=1, all rollback
+ * links also get that parameter. It causes the edit itself and the rollback
+ * to be marked as "bot" edits. Bot edits are hidden by default from recent
+ * changes, so this allows sysops to combat a busy vandal without bothering
+ * other users.
+ * 
+ * @todo This would probably look a lot nicer in a table.
+ */
+function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew, $target, $oldid ) {
        global $wgLang, $wgOut, $wgUser, $wgRequest;
        $page = Title::makeName( $ns, $t );
        $link = $sk->makeKnownLink( $page, "" );
@@ -220,8 +222,10 @@ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew, $t
        $wgOut->addHTML( "<li>{$d} {$histlink} {$mflag} {$link} {$comment}{$topmarktext}{$oldtext}</li>\n" );
 }
 
-function ucCountLink( $lim, $d )
-{
+/**
+ *
+ */
+function ucCountLink( $lim, $d ) {
        global $wgUser, $wgLang, $wgRequest;
 
        $target = $wgRequest->getText( 'target' );
@@ -231,8 +235,10 @@ function ucCountLink( $lim, $d )
        return $s;
 }
 
-function ucDaysLink( $lim, $d )
-{
+/**
+ *
+ */
+function ucDaysLink( $lim, $d ) {
        global $wgUser, $wgLang, $wgRequest;
 
        $target = $wgRequest->getText( 'target' );
index 24a3699..fdd8508 100644 (file)
@@ -1,23 +1,41 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( "QueryPage.php" );
 
+/**
+ *
+ */
 class DeadendPagesPage extends PageQueryPage {
 
        function getName( ) {
                return "Deadendpages";
        }
 
-       # LEFT JOIN is expensive
-    
+       /**
+        * LEFT JOIN is expensive
+        *
+        * @return true
+        */
        function isExpensive( ) {
                return 1;
        }
 
+       /**
+        * @return false
+        */
        function sortDescending() {
                return false;
        }
-    
+       
+    /**
+        * @return string an sqlquery
+        */
        function getSQL() {
                $dbr =& wfGetDB( DB_SLAVE );
                extract( $dbr->tableNames( 'cur', 'links' ) );
@@ -29,6 +47,9 @@ class DeadendPagesPage extends PageQueryPage {
     }
 }
 
+/**
+ * Constructor
+ */
 function wfSpecialDeadendpages() {
     
     list( $limit, $offset ) = wfCheckLimits();
index 9bac259..9e8fef7 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialDebug()
-{
+/**
+ * Let developpers receive the full phpinfo output
+ */
+/**
+ *
+ */
+function wfSpecialDebug() {
        global $wgUser, $wgOut;
 
        if ( ! $wgUser->isDeveloper() ) {
@@ -10,4 +15,3 @@ function wfSpecialDebug()
        }
        phpinfo();
 }
-
index 04f56ca..5fda168 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once('QueryPage.php');
 
+/**
+ *
+ */
 class DisambiguationsPage extends PageQueryPage {
 
        function getName() {
@@ -52,6 +61,9 @@ class DisambiguationsPage extends PageQueryPage {
        }
 }
 
+/**
+ * Constructor
+ */
 function wfSpecialDisambiguations() {
        list( $limit, $offset ) = wfCheckLimits();
        
index 1c98a05..775bc6e 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ * 
+ */
 require_once('QueryPage.php');
 
+/**
+ *
+ */
 class DoubleRedirectsPage extends PageQueryPage {
 
        function getName() {
@@ -44,6 +53,9 @@ class DoubleRedirectsPage extends PageQueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialDoubleRedirects() {
        list( $limit, $offset ) = wfCheckLimits();
        
index 11e6a63..9b95494 100644 (file)
@@ -1,5 +1,11 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once('UserMailer.php');
 
 function wfSpecialEmailuser( $par ) {
@@ -45,14 +51,16 @@ function wfSpecialEmailuser( $par ) {
        else { $f->showForm( "" ); }
 }
 
+/**
+ * @todo document
+ */
 class EmailUserForm {
 
        var $mAddress;
        var $target;
        var $text, $subject;
 
-       function EmailUserForm( $addr, $target )
-       {
+       function EmailUserForm( $addr, $target ) {
                global $wgRequest;
                $this->mAddress = $addr;
                $this->target = $target;
@@ -60,8 +68,7 @@ class EmailUserForm {
                $this->subject = $wgRequest->getText( 'wpSubject' );
        }
 
-       function showForm( $err )
-       {
+       function showForm( $err ) {
                global $wgOut, $wgUser, $wgLang;
 
                $wgOut->setPagetitle( wfMsg( "emailpage" ) );
@@ -114,8 +121,7 @@ class EmailUserForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgLang, $wgOutputEncoding;
            
                $from = wfQuotedPrintable( $wgUser->getName() ) . " <" . $wgUser->getEmail() . ">";
@@ -132,8 +138,7 @@ class EmailUserForm {
                        $wgOut->addHTML( wfMsg( "usermailererror" ) . $mailResult);
        }
 
-       function showSuccess()
-       {
+       function showSuccess() {
                global $wgOut, $wgUser;
 
                $wgOut->setPagetitle( wfMsg( "emailsent" ) );
index a72904b..24c8dff 100644 (file)
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
-function wfSpecialExport( $page = "" ) {
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialExport( $page = '' ) {
        global $wgOut, $wgLang, $wgRequest;
        
        if( $wgRequest->getVal( 'action' ) == 'submit') {
@@ -28,7 +35,7 @@ function wfSpecialExport( $page = "" ) {
                $curonly = true;
        }
        
-       if( $page != "" ) {
+       if( $page != '' ) {
                header( "Content-type: application/xml; charset=utf-8" );
                $pages = explode( "\n", $page );
                $xml = pages2xml( $pages, $curonly );
index 1eac8db..73c8f7a 100644 (file)
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
-function wfSpecialGeo( $page = "" ) {
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialGeo( $page = '' ) {
        global $wgOut, $wgLang, $wgRequest;
        $coordinates = $wgRequest->getText( 'coordinates' ) ;
        $coordinates = explode ( ":" , $coordinates ) ;
index f27f9c7..7b762d0 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialImagelist()
-{
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialImagelist() {
        global $wgUser, $wgOut, $wgLang, $wgRequest;
        
        $sort = $wgRequest->getVal( 'sort' );
index 1fc1eeb..c3cef11 100644 (file)
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
-function wfSpecialImport( $page = "" ) {
+/**
+ *
+ */
+
+/**
+ * Constructor
+ */
+function wfSpecialImport( $page = '' ) {
        global $wgOut, $wgLang, $wgRequest, $wgTitle;
        global $wgImportSources;
        
@@ -99,6 +106,9 @@ function wfImportOldRevision( &$revision ) {
        $dbw->deadlockLoop( array( &$revision, 'importOldRevision' ) );
 }
 
+/**
+ *
+ */
 class WikiRevision {
        var $title = NULL;
        var $timestamp = "20010115000000";
@@ -164,6 +174,9 @@ class WikiRevision {
        }
 }
 
+/**
+ *
+ */
 class WikiImporter {
        var $mSource = NULL;
        var $mError = "";
index cf15f4d..7e17d89 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialIpblocklist()
-{
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialIpblocklist() {
        global $wgUser, $wgOut, $wgRequest;
        
        $ip = $wgRequest->getVal( 'wpUnblockAddress', $wgRequest->getVal( 'ip' ) );
@@ -26,6 +31,9 @@ function wfSpecialIpblocklist()
        }
 }
 
+/**
+ * 
+ */
 class IPUnblockForm {
        var $ip, $reason;
        
@@ -78,8 +86,7 @@ class IPUnblockForm {
 
        }
        
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgLang;
 
                $block = new Block();
@@ -105,8 +112,7 @@ class IPUnblockForm {
                $wgOut->redirect( $success );
        }
 
-       function showList( $msg )
-       {
+       function showList( $msg ) {
                global $wgOut;
                
                $wgOut->setPagetitle( wfMsg( "ipblocklist" ) );
@@ -119,7 +125,9 @@ class IPUnblockForm {
        }
 }
 
-# Callback function to output a block
+/**
+ * Callback function to output a block
+ */
 function wfAddRow( $block, $tag ) {
        global $wgOut, $wgUser, $wgLang;
 
index 39d86fd..bce7fee 100644 (file)
@@ -1,10 +1,17 @@
 <?php
-#
-# This class is used to get a list of users flagged with "sysop"
-# right.
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once("QueryPage.php");
 
+/**
+ * This class is used to get a list of users flagged with "sysop" right.
+ *
+ */
 class ListAdminsPage extends PageQueryPage {
 
        function getName() {
@@ -26,6 +33,9 @@ class ListAdminsPage extends PageQueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialListadmins() {
        list( $limit, $offset ) = wfCheckLimits();
 
index 1e32ade..576e31b 100644 (file)
@@ -1,11 +1,19 @@
 <?php
-#
-# This class is used to get a list of user. The ones with specials
-# rights (sysop, bureaucrat, developer) will have them displayed
-# next to their names.
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once("QueryPage.php");
 
+/**
+ * This class is used to get a list of user. The ones with specials
+ * rights (sysop, bureaucrat, developer) will have them displayed
+ * next to their names.
+ *
+ */
 class ListUsersPage extends QueryPage {
 
        function getName() {
@@ -37,6 +45,9 @@ class ListUsersPage extends QueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialListusers() {
        global $wgUser, $wgOut, $wgLang;
 
index ff26cc3..2e758ad 100644 (file)
@@ -1,5 +1,11 @@
 <?php
+/**
+ *
+ */
 
+/**
+ * Constructor
+ */
 function wfSpecialLockdb()
 {
        global $wgUser, $wgOut, $wgRequest;
@@ -16,8 +22,11 @@ function wfSpecialLockdb()
        else { $f->showForm( "" ); }
 }
 
+/**
+ *
+ */
 class DBLockForm {
-       var $reason = "";
+       var $reason = '';
        
        function DBLockForm() {
                global $wgRequest;
@@ -59,8 +68,7 @@ class DBLockForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgLang, $wgRequest;
                global $wgReadOnlyFile;
 
@@ -83,8 +91,7 @@ class DBLockForm {
                $wgOut->redirect( $titleObj->getFullURL( "action=success" ) );
        }
 
-       function showSuccess()
-       {
+       function showSuccess() {
                global $wgOut, $wgUser;
 
                $wgOut->setPagetitle( wfMsg( "lockdb" ) );
index 10b770b..3b86bfc 100644 (file)
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
+/**
+ *
+ */
+
+/**
+ * constructor
+ */
 function wfSpecialLog( $par = '' ) {
        global $wgRequest;
        $logReader =& new LogReader( $wgRequest );
@@ -27,6 +34,9 @@ function wfSpecialLog( $par = '' ) {
        $logViewer->show();
 }
 
+/**
+ *
+ */
 class LogReader {
        var $db, $joinClauses, $whereClauses;
        var $type = '', $user = '', $title = null;
@@ -130,6 +140,9 @@ class LogReader {
        }
 }
 
+/**
+ *
+ */
 class LogViewer {
        var $reader, $skin;
        
@@ -250,4 +263,4 @@ class LogViewer {
 }
 
 
-?>
\ No newline at end of file
+?>
index 5bf4d88..b1b2b20 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( "QueryPage.php" );
 
+/**
+ *
+ */
 class LonelyPagesPage extends PageQueryPage {
 
        function getName() {
@@ -26,6 +35,9 @@ class LonelyPagesPage extends PageQueryPage {
        }
 }
 
+/**
+ * Constructor
+ */
 function wfSpecialLonelypages() {
        list( $limit, $offset ) = wfCheckLimits();
 
index 36c1c75..d2ba4ff 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( "QueryPage.php" );
 
+/**
+ *
+ */
 class LongPagesPage extends QueryPage {
 
        function getName() {
@@ -33,6 +42,9 @@ class LongPagesPage extends QueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialLongpages()
 {
     list( $limit, $offset ) = wfCheckLimits();
index 8b76d3e..3c6c934 100644 (file)
@@ -1,6 +1,11 @@
 <?php
+/**
+ *
+ */
 
-# shortcut to get the current language "special" namespace name
+/**
+ * shortcut to get the current language "special" namespace name
+ */
 function sns() {
        global $wgLang ;
        $ns = $wgLang->getNamespaces() ;
@@ -8,7 +13,9 @@ function sns() {
 }
 
 
-# Entry point
+/**
+ * Entry point
+ */
 function wfSpecialMaintenance( $par=NULL ) {
        global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest, $wgLanguageCode;
        global $wgMiserMode;
@@ -84,7 +91,9 @@ function wfSpecialMaintenance( $par=NULL ) {
        $wgOut->addHTML ( $r ) ;
 }
 
-# Generate a maintenance page link
+/**
+ * Generate a maintenance page link
+ */
 function getMPL ( $x ) {
        global $wgUser , $wgLang;
        $sk = $wgUser->getSkin() ;
@@ -108,8 +117,12 @@ function getMaintenancePageBacklink( $subfunction ) {
 }
 
 
-# Disambiguations, DoubleRedirects and BrokenRedirects are now using the
-# QueryPage class. Code is in a Special*.php file.
+/**#@+
+ * Disambiguations, DoubleRedirects and BrokenRedirects are now using the
+ * QueryPage class. Code is in a Special*.php file.
+ *
+ * @deprecated
+ */
 function wfSpecialDoubleRedirects() {
        global $wgOut;
        $t = Title::makeTitle( NS_SPECIAL, "DoubleRedirects" );
@@ -127,10 +140,15 @@ function wfSpecialDisambiguations() {
        $t = Title::makeTitle( NS_SPECIAL, "Disambiguations" );
        $wgOut->redirect ($t->getFullURL());
 }
+/**#@-*/
 
 
-# This doesn't really work anymore, because self-links are now displayed as
-# unlinked bold text, and are not entered into the link table.
+/**
+ * This doesn't really work anymore, because self-links are now displayed as
+ * unlinked bold text, and are not entered into the link table.
+ *
+ * @deprecated
+ */
 function wfSpecialSelfLinks() {
        global $wgUser, $wgOut, $wgLang, $wgTitle;
        $fname = 'wfSpecialSelfLinks';
@@ -164,7 +182,9 @@ function wfSpecialSelfLinks() {
        $wgOut->addHTML( "<p>{$sl}\n" );
 }
 
-
+/**
+ * 
+ */
 function wfSpecialMispeelings () {
        global $wgUser, $wgOut, $wgLang, $wgTitle;
        $sk = $wgUser->getSkin();
@@ -231,7 +251,9 @@ function wfSpecialMispeelings () {
        $wgOut->addHTML( "<p>{$sl}\n" );
 }
 
-
+/**
+ *
+ */
 function wfSpecialMissingLanguageLinks() {
        global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest;
        
index 15fa120..0f3f4c1 100644 (file)
@@ -1,8 +1,17 @@
 <?php
+/**
+ *
+ */
+
+/**
+ *
+ */
 require_once( "LinksUpdate.php" );
 
-function wfSpecialMakesysop()
-{
+/**
+ * Constructor
+ */
+function wfSpecialMakesysop() {
        global $wgUser, $wgOut, $wgRequest;
 
        if ( 0 == $wgUser->getID() or $wgUser->isBlocked() ) {
@@ -24,15 +33,17 @@ function wfSpecialMakesysop()
        if ( $f->mSubmit ) { 
                $f->doSubmit(); 
        } else { 
-               $f->showForm( "" ); 
+               $f->showForm( '' ); 
        }
 }
 
+/**
+ *
+ */
 class MakesysopForm {
        var $mTarget, $mAction, $mRights, $mUser, $mSubmit;
 
-       function MakesysopForm( &$request ) 
-       {
+       function MakesysopForm( &$request ) {
                $this->mAction = $request->getText( 'action' );
                $this->mRights = $request->getVal( 'wpRights' );
                $this->mUser = $request->getText( 'wpMakesysopUser' );
@@ -40,8 +51,7 @@ class MakesysopForm {
                $this->mBuro = $request->getBool( 'wpSetBureaucrat' );
        }
 
-       function showForm( $err = "")
-       {
+       function showForm( $err = '') {
                global $wgOut, $wgUser, $wgLang;
 
                if ( $wgUser->isDeveloper() ) {
@@ -119,8 +129,7 @@ class MakesysopForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgLang;
                global $wgDBname, $wgMemc, $wgLocalDatabases;
 
@@ -208,8 +217,7 @@ class MakesysopForm {
                }
        }
 
-       function showSuccess()
-       {
+       function showSuccess() {
                global $wgOut, $wgUser;
 
                $wgOut->setPagetitle( wfMsg( "makesysoptitle" ) );
@@ -225,8 +233,7 @@ class MakesysopForm {
 
        }
 
-       function showFail()
-       {
+       function showFail() {
                global $wgOut, $wgUser;
 
                $wgOut->setPagetitle( wfMsg( "makesysoptitle" ) );
index 05bb470..4fc6435 100644 (file)
@@ -1,8 +1,17 @@
 <?php
+/**
+ *
+ */
+
+/**
+ *
+ */
 require_once( "LinksUpdate.php" );
 
-function wfSpecialMovepage()
-{
+/**
+ * Constructor
+ */
+function wfSpecialMovepage() {
        global $wgUser, $wgOut, $wgRequest, $action, $wgOnlySysopMayMove;
 
        # check rights. We don't want newbies to move pages to prevents possible attack
@@ -23,6 +32,9 @@ function wfSpecialMovepage()
        else { $f->showForm( '' ); }
 }
 
+/**
+ *
+ */
 class MovePageForm {
        var $oldTitle, $newTitle; # Text input
                
@@ -32,8 +44,7 @@ class MovePageForm {
                $this->newTitle = $wgRequest->getText( 'wpNewTitle' );
        }
        
-       function showForm( $err )
-       {
+       function showForm( $err ) {
                global $wgOut, $wgUser, $wgLang;
 
                $wgOut->setPagetitle( wfMsg( 'movepage' ) );
@@ -101,8 +112,7 @@ class MovePageForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgLang;
                global $wgDeferredUpdateList, $wgMessageCache;
                global  $wgUseSquid, $wgRequest;
@@ -179,8 +189,7 @@ class MovePageForm {
                $wgOut->redirect( $success );
        }
 
-       function showSuccess()
-       {
+       function showSuccess() {
                global $wgOut, $wgUser, $wgRequest;
 
                $wgOut->setPagetitle( wfMsg( 'movepage' ) );
index 9889469..199cf00 100644 (file)
@@ -1,10 +1,15 @@
 <?php
-# Suggestion from mailing list: lists pages in order
-# least recently reviewed.
-#
+/**
+ * Suggestion from mailing list: lists pages in order
+ * least recently reviewed.
+ *
+ * @todo code it !
+ */
 
-function wfSpecialNeglectedpages()
-{
+/**
+ *
+ */
+function wfSpecialNeglectedpages() {
        global $wgUser, $wgOut;
 
        $wgOut->addHTML( "<p>(TODO: neglected pages)" );
index 04ab8e7..f27d17a 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( "QueryPage.php" );
 
+/**
+ *
+ */
 class NewPagesPage extends QueryPage {
 
        function getName() {
@@ -76,6 +85,9 @@ class NewPagesPage extends QueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialNewpages()
 {
        global $wgRequest;
index 92c18d6..426fd09 100644 (file)
@@ -1,18 +1,26 @@
 <?php
-# SpecialPage: handling special pages and lists thereof
-
-# $wgSpecialPages is a list of all SpecialPage objects. These objects are either instances of
-# SpecialPage or a sub-class thereof. They have an execute() method, which sends the HTML for the
-# special page to $wgOut. The parent class has an execute() method which distributes the call to
-# the historical global functions. Additionally, execute() also checks if the user has the
-# necessary access privileges and bails out if not.
-
-# To add a special page at run-time, use SpecialPage::addPage().
-# DO NOT manipulate this array at run-time.
+/**
+ * SpecialPage: handling special pages and lists thereof
+ * $wgSpecialPages is a list of all SpecialPage objects. These objects are
+ * either instances of SpecialPage or a sub-class thereof. They have an
+ * execute() method, which sends the HTML for the special page to $wgOut.
+ * The parent class has an execute() method which distributes the call to
+ * the historical global functions. Additionally, execute() also checks if the
+ * user has the necessary access privileges and bails out if not.
+ *
+ * To add a special page at run-time, use SpecialPage::addPage().
+ * DO NOT manipulate this array at run-time.
+ */
 
+/**
+ *
+ */
 global $wgSpecialPages;
 
-/* private */ $wgSpecialPages = array(
+/**
+ * @access private
+ */
+$wgSpecialPages = array(
        'DoubleRedirects'       => new UnlistedSpecialPage ( 'DoubleRedirects' ),
        'BrokenRedirects'       => new UnlistedSpecialPage ( 'BrokenRedirects' ),
        'Disambiguations'       => new UnlistedSpecialPage ( 'Disambiguations' ),
@@ -33,8 +41,7 @@ global $wgSpecialPages;
        "Unusedimages"      => new SpecialPage( "Unusedimages" )
 );
 global $wgDisableCounters;
-if( !$wgDisableCounters )
-{
+if( !$wgDisableCounters ) {
        $wgSpecialPages["Popularpages"] = new SpecialPage( "Popularpages" );
 }
 $wgSpecialPages = array_merge($wgSpecialPages, array (
@@ -75,7 +82,10 @@ $wgSpecialPages = array_merge($wgSpecialPages, array (
        "Unlockdb"              => new SpecialPage( "Unlockdb", "developer" )
 ));
 
-# Parent special page class, also static functions for handling the special page list
+/**
+ * Parent special page class, also static functions for handling the special
+ * page list
+ */
 class SpecialPage
 {
        /* private */ var $mName; # The name of the class, used in the URL. Also used for the default
@@ -267,7 +277,9 @@ class SpecialPage
        }
 }
 
-# Shortcut to construct a special page which is unlisted by default
+/**
+ * Shortcut to construct a special page which is unlisted by default
+ */
 class UnlistedSpecialPage extends SpecialPage
 {
        function UnlistedSpecialPage( $name, $restriction = "", $function = false, $file = "default" ) {
index 23ad570..a261ce1 100644 (file)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( "QueryPage.php" );
 
+/**
+ *
+ */
 class PopularPagesPage extends QueryPage {
 
        function getName() {
@@ -34,8 +43,10 @@ class PopularPagesPage extends QueryPage {
        }
 }
 
-function wfSpecialPopularpages()
-{
+/**
+ * Constructor
+ */
+function wfSpecialPopularpages() {
     list( $limit, $offset ) = wfCheckLimits();
     
     $ppp = new PopularPagesPage();
index e8bfc32..5796d9d 100644 (file)
@@ -1,12 +1,21 @@
 <?php
-function wfSpecialPreferences()
-{
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialPreferences() {
        global $wgRequest;
 
        $form = new PreferencesForm( $wgRequest );
        $form->execute();
 }
 
+/**
+ *
+ */
 class PreferencesForm {
        var $mQuickbar, $mOldpass, $mNewpass, $mRetypePass, $mStubs;
        var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick;
index fa8c348..825900d 100644 (file)
@@ -1,10 +1,16 @@
 <?php
 # $Id$
 
-function wfSpecialRandompage()
-{
+/**
+ *
+ */
+
+/**
+ * Constructor
+ */
+function wfSpecialRandompage() {
        global $wgOut, $wgTitle, $wgArticle, $wgExtraRandompageSQL;
-       $fname = "wfSpecialRandompage";
+       $fname = 'wfSpecialRandompage';
 
        $rand = mt_rand() / mt_getrandmax();
        # interpolation and sprintf() can muck up with locale-specific decimal separator
index 1efacda..d78d779 100644 (file)
@@ -1,9 +1,17 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( 'Feed.php' );
 
-function wfSpecialRecentchanges( $par )
-{
+/**
+ * Constructor
+ */
+function wfSpecialRecentchanges( $par ) {
        global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc, $wgDBname;
        global $wgRequest, $wgSitename, $wgLanguageCode;
        global $wgFeedClasses;
@@ -156,8 +164,10 @@ function wfSpecialRecentchanges( $par )
        }
 }
 
-function rcCountLink( $lim, $d, $page='Recentchanges', $more='' )
-{
+/**
+ *
+ */
+function rcCountLink( $lim, $d, $page='Recentchanges', $more='' ) {
        global $wgUser, $wgLang;
        $sk = $wgUser->getSkin();
        $s = $sk->makeKnownLink( $wgLang->specialPage( $page ),
@@ -166,8 +176,10 @@ function rcCountLink( $lim, $d, $page='Recentchanges', $more='' )
        return $s;
 }
 
-function rcDaysLink( $lim, $d, $page='Recentchanges', $more='' )
-{
+/**
+ *
+ */
+function rcDaysLink( $lim, $d, $page='Recentchanges', $more='' ) {
        global $wgUser, $wgLang;
        $sk = $wgUser->getSkin();
        $s = $sk->makeKnownLink( $wgLang->specialPage( $page ),
@@ -176,9 +188,11 @@ function rcDaysLink( $lim, $d, $page='Recentchanges', $more='' )
        return $s;
 }
 
+/**
+ *
+ */
 function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall = false, $minorLink = '',
-       $botLink = '', $liuLink = '', $patrLink = '' )
-{
+       $botLink = '', $liuLink = '', $patrLink = '' ) {
        if ($more != '') $more .= '&';
        $cl = rcCountLink( 50, $days, $page, $more ) . ' | ' .
          rcCountLink( 100, $days, $page, $more  ) . ' | ' .
@@ -196,9 +210,10 @@ function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall
        return $note;
 }
 
-# Obsolete? Isn't called from anywhere and $mlink isn't defined
-function rcLimitLinks( $page='Recentchanges', $more='', $doall = false )
-{
+/**
+ * Obsolete? Isn't called from anywhere and $mlink isn't defined
+ */
+function rcLimitLinks( $page='Recentchanges', $more='', $doall = false ) {
        if ($more != '') $more .= '&';
        $cl = rcCountLink( 50, 0, $page, $more ) . ' | ' .
          rcCountLink( 100, 0, $page, $more  ) . ' | ' .
index 4f1ad3b..e14ae9b 100644 (file)
@@ -1,8 +1,17 @@
 <?php
+/**
+ *
+ */
+
+/**
+ *
+ */
 require_once( "SpecialRecentchanges.php" );
 
-function wfSpecialRecentchangeslinked( $par = NULL )
-{
+/**
+ * constructor
+ */
+function wfSpecialRecentchangeslinked( $par = NULL ) {
        global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest;
        $fname = "wfSpecialRecentchangeslinked";
 
index ad815a1..acaa729 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-# Token special page for marking search requests properly in the skin.
-# 
 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>
 # http://www.mediawiki.org/
 # 
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
+/**
+ * Token special page for marking search requests properly in the skin.
+ */
+
+/**
+ * constructor
+ */
 function wfSpecialSearch( $par ) {
        global $wgOutput;
        require_once( 'SearchEngine.php' );
@@ -28,4 +33,4 @@ function wfSpecialSearch( $par ) {
 
 # Hey, it could be worse. It could be /bin/true on Solaris!
 
-?>
\ No newline at end of file
+?>
index 4feb514..2308552 100644 (file)
@@ -1,11 +1,17 @@
 <?php
-#
-# SpecialShortpages extends QueryPage. It is used to return the shortest
-# pages in the database.
-#
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once("QueryPage.php");
 
+/**
+ * SpecialShortpages extends QueryPage. It is used to return the shortest
+ * pages in the database.
+ */
 class ShortPagesPage extends QueryPage {
 
        function getName() {
@@ -41,6 +47,9 @@ class ShortPagesPage extends QueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialShortpages() {
        list( $limit, $offset ) = wfCheckLimits();
 
index e60910f..98587a7 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialSpecialpages()
-{
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialSpecialpages() {
        global $wgLang, $wgOut, $wgUser;
        
        $wgOut->setRobotpolicy( "index,nofollow" );
@@ -25,13 +30,13 @@ function wfSpecialSpecialpages()
        }
 }
 
-# sub function generating the list of pages
-#   $pages   : the list of pages
-#   $heading : header to be used
-#   $sk      : skin object ???
-
-function wfSpecialSpecialpages_gen($pages,$heading,$sk)
-{
+/**
+ * sub function generating the list of pages
+ * @param $pages the list of pages
+ * @param $heading header to be used
+ * @param $sk skin object ???
+ */
+function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
        global $wgLang, $wgOut, $wgAllowSysopQueries;
 
        $wgOut->addHTML( "<h2>" . wfMsg( $heading ) . "</h2>\n<ul>" );
index 67fcc61..ca82750 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialStatistics()
-{
+/**
+ *
+ */
+
+/**
+ * constructor
+ */
+function wfSpecialStatistics() {
        global $wgUser, $wgOut, $wgLang;
        $fname = "wfSpecialStatistics";
 
index 8faeff6..7e79a86 100755 (executable)
@@ -1,7 +1,16 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( "QueryPage.php" );
 
+/**
+ *
+ */
 class UncategorizedPagesPage extends PageQueryPage {
 
        function getName() {
@@ -26,6 +35,9 @@ class UncategorizedPagesPage extends PageQueryPage {
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialUncategorizedpages() {
        list( $limit, $offset ) = wfCheckLimits();
 
index ba81557..0553453 100644 (file)
@@ -1,13 +1,21 @@
 <?php
+/**
+ *
+ */
 
-function wfSpecialUndelete( $par )
-{
+/**
+ *
+ */
+function wfSpecialUndelete( $par ) {
     global $wgRequest;
 
        $form = new UndeleteForm( $wgRequest, $par );
        $form->execute();
 }
 
+/**
+ *
+ */
 class PageArchive {
        var $title;
        
@@ -165,6 +173,9 @@ class PageArchive {
        }
 }
 
+/**
+ *
+ */
 class UndeleteForm {
        var $mAction, $mTarget, $mTimestamp, $mRestore, $mTargetObj;
 
index 589f89f..5e51e8a 100644 (file)
@@ -1,7 +1,12 @@
 <?php
+/**
+ *
+ */
 
-function wfSpecialUnlockdb()
-{
+/**
+ *
+ */
+function wfSpecialUnlockdb() {
        global $wgUser, $wgOut, $wgRequest;
 
        if ( ! $wgUser->isDeveloper() ) {
@@ -16,6 +21,9 @@ function wfSpecialUnlockdb()
        else { $f->showForm( "" ); }
 }
 
+/**
+ *
+ */
 class DBUnlockForm {
        function showForm( $err )
        {
@@ -48,8 +56,7 @@ class DBUnlockForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgLang;
                global $wgRequest, $wgReadOnlyFile;
 
@@ -67,8 +74,7 @@ class DBUnlockForm {
                $wgOut->redirect( $success );
        }
 
-       function showSuccess()
-       {
+       function showSuccess() {
                global $wgOut, $wgUser;
                global $ip;
 
index 48961cf..18e4eef 100644 (file)
@@ -1,5 +1,11 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 function wfSpecialUnusedimages() {
        global $wgUser, $wgOut, $wgLang, $wgTitle;
        $fname = "wfSpecialUnusedimages";
index dde523c..101cd4b 100644 (file)
@@ -1,14 +1,25 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once( "Image.php" );
 
-function wfSpecialUpload()
-{
+/**
+ * Constructor
+ */
+function wfSpecialUpload() {
        global $wgRequest;
        $form = new UploadForm( $wgRequest );
        $form->execute();
 }
 
+/**
+ *
+ */
 class UploadForm {
        var $mUploadAffirm, $mUploadFile, $mUploadDescription, $mIgnoreWarning;
        var $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion;
@@ -70,8 +81,7 @@ class UploadForm {
        }
 
 
-       function processUpload()
-       {
+       function processUpload() {
                global $wgUser, $wgOut, $wgLang;
                global $wgUploadDirectory;
                global $wgSavedFile, $wgUploadOldVersion;
@@ -185,8 +195,7 @@ class UploadForm {
                return in_array( strtolower( $ext ), $list );
        }
 
-       function saveUploadedFile( $saveName, $tempName )
-       {
+       function saveUploadedFile( $saveName, $tempName ) {
                global $wgSavedFile, $wgUploadOldVersion;
                global $wgUploadDirectory, $wgOut;
 
@@ -211,8 +220,7 @@ class UploadForm {
                chmod( $wgSavedFile, 0644 );
        }
 
-       function unsaveUploadedFile()
-       {
+       function unsaveUploadedFile() {
                global $wgUploadDirectory, $wgOut, $wgRequest;
                
                $wgSavedFile = $_SESSION['wsUploadFiles'][$this->mSessionKey];
@@ -234,16 +242,14 @@ class UploadForm {
                }
        }
 
-       function uploadError( $error )
-       {
+       function uploadError( $error ) {
                global $wgOut;
                $sub = wfMsg( "uploadwarning" );
                $wgOut->addHTML( "<h2>{$sub}</h2>\n" );
                $wgOut->addHTML( "<h4 style='error'>{$error}</h4>\n" );
        }
 
-       function uploadWarning( $warning )
-       {
+       function uploadWarning( $warning ) {
                global $wgOut, $wgUser, $wgLang, $wgUploadDirectory, $wgRequest;
                global $wgSavedFile, $wgUploadOldVersion;
                global $wgUseCopyrightUpload;
@@ -294,8 +300,7 @@ class UploadForm {
        </td><td align='left'>{$reup}</td></tr></table></form>\n" );
        }
 
-       function mainUploadForm( $msg )
-       {
+       function mainUploadForm( $msg ) {
                global $wgOut, $wgUser, $wgLang, $wgUploadDirectory, $wgRequest;
                global $wgUseCopyrightUpload;
 
index 26672bc..8a14b64 100644 (file)
@@ -1,9 +1,17 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 require_once('UserMailer.php');
 
-function wfSpecialUserlogin()
-{
+/**
+ * consutrctor
+ */
+function wfSpecialUserlogin() {
        global $wgCommandLineMode;
        global $wgRequest;
        if( !$wgCommandLineMode && !isset( $_COOKIE[ini_get("session.name")] )  ) {
@@ -14,6 +22,9 @@ function wfSpecialUserlogin()
        $form->execute();
 }
 
+/**
+ *
+ */
 class LoginForm {
        var $mName, $mPassword, $mRetype, $mReturnto, $mCookieCheck, $mPosted;
        var $mAction, $mCreateaccount, $mCreateaccountMail, $mMailmypassword;
@@ -65,8 +76,10 @@ class LoginForm {
                $this->mainLoginForm( "" );
        }
 
-       /* private */ function addNewAccountMailPassword()
-       {
+       /**
+        * @access private
+        */
+       function addNewAccountMailPassword() {
                global $wgOut;
                
                if ("" == $this->mEmail) {
@@ -98,8 +111,10 @@ class LoginForm {
        }
 
 
-       /* private */ function addNewAccount()
-       {
+       /**
+        * @access private
+        */
+       function addNewAccount() {
                global $wgUser, $wgOut;
                global $wgDeferredUpdateList;
 
@@ -123,8 +138,10 @@ class LoginForm {
        }
 
 
-       /* private */ function addNewAccountInternal()
-       {
+       /**
+        * @access private
+        */
+       function addNewAccountInternal() {
                global $wgUser, $wgOut;
                global $wgMaxNameChars;
                global $wgMemc, $wgAccountCreationThrottle, $wgDBname, $wgIP;
@@ -184,10 +201,10 @@ class LoginForm {
                return $u;
        }
 
-
-
-       /* private */ function processLogin()
-       {
+       /**
+        * @access private
+        */
+       function processLogin() {
                global $wgUser;
                global $wgDeferredUpdateList;
 
@@ -231,8 +248,10 @@ class LoginForm {
                }
        }
 
-       /* private */ function mailPassword()
-       {
+       /**
+        * @access private
+        */
+       function mailPassword() {
                global $wgUser, $wgDeferredUpdateList, $wgOutputEncoding;
                global $wgCookiePath, $wgCookieDomain, $wgDBname;
 
@@ -259,8 +278,10 @@ class LoginForm {
        }
 
 
-       /* private */ function mailPasswordInternal( $u )
-       {
+       /**
+        * @access private
+        */
+       function mailPasswordInternal( $u ) {
                global $wgDeferredUpdateList, $wgOutputEncoding;
                global $wgPasswordSender, $wgDBname, $wgIP;
                global $wgCookiePath, $wgCookieDomain;
@@ -286,11 +307,10 @@ class LoginForm {
        }
 
 
-
-
-
-       /* private */ function successfulLogin( $msg )
-       {
+       /**
+        * @access private
+        */
+       function successfulLogin( $msg ) {
                global $wgUser;
                global $wgDeferredUpdateList;
                global $wgOut;
@@ -302,8 +322,7 @@ class LoginForm {
                $wgOut->returnToMain();
        }
 
-       function userNotPrivilegedMessage()
-       {
+       function userNotPrivilegedMessage() {
                global $wgOut, $wgUser, $wgLang;
                
                $wgOut->setPageTitle( wfMsg( "whitelistacctitle" ) );
@@ -315,8 +334,10 @@ class LoginForm {
                $wgOut->returnToMain( false );
        }
 
-       /* private */ function mainLoginForm( $err )
-       {
+       /**
+        * @access private
+        */
+       function mainLoginForm( $err ) {
                global $wgUser, $wgOut, $wgLang;
                global $wgDBname, $wgAllowRealName;
 
@@ -449,14 +470,18 @@ class LoginForm {
                $wgOut->addHTML( $endText );
        }
 
-       /* private */ function hasSessionCookie()
-       {
+       /**
+        * @access private
+        */
+       function hasSessionCookie() {
                global $wgDisableCookieCheck;
                return ( $wgDisableCookieCheck ) ? true : ( "" != $_COOKIE[session_name()] );
        }
          
-       /* private */ function cookieRedirectCheck( $type )
-       {
+       /**
+        * @access private
+        */
+       function cookieRedirectCheck( $type ) {
                global $wgOut, $wgLang;
 
                $titleObj = Title::makeTitle( NS_SPECIAL, "Userlogin" );
@@ -465,7 +490,10 @@ class LoginForm {
                return $wgOut->redirect( $check );
        }
 
-       /* private */ function onCookieRedirectCheck( $type ) {
+       /**
+        * @access private
+        */
+       function onCookieRedirectCheck( $type ) {
                global $wgUser;
 
                if ( !$this->hasSessionCookie() ) {
@@ -482,7 +510,10 @@ class LoginForm {
                }
        }
 
-       /* private */ function throttleHit( $limit ) {
+       /**
+        * @access private
+        */
+       function throttleHit( $limit ) {
                global $wgOut;
 
                $wgOut->addWikiText( wfMsg( 'acct_creation_throttle_hit', $limit ) );
index 182c9bf..d62703c 100644 (file)
@@ -1,13 +1,18 @@
 <?php
+/**
+ *
+ */
 
-function wfSpecialUserlogout()
-{
+/**
+ * constructor
+ */
+function wfSpecialUserlogout() {
        global $wgUser, $wgOut, $returnto;
 
        $wgUser->logout();
        $wgOut->mCookies = array();
-       $wgOut->setRobotpolicy( "noindex,nofollow" );
-       $wgOut->addHTML( wfMsg( "logouttext" ) );
+       $wgOut->setRobotpolicy( 'noindex,nofollow' );
+       $wgOut->addHTML( wfMsg( 'logouttext' ) );
        $wgOut->returnToMain();
 }
 
index 9bdf201..04a86b0 100644 (file)
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
+/**
+ *
+ */
+
+/**
+ *
+ */
 class Validation {
        
        function find_this_version( $article_title , &$article_time , &$id , &$tab ) {
@@ -512,7 +519,10 @@ class Validation {
 
 }
 
-function wfSpecialValidate( $page = "" ) {
+/**
+ * constructor
+ */
+function wfSpecialValidate( $page = '' ) {
        global $wgOut, $wgRequest, $wgUseValidation;
 
        if( !$wgUseValidation ) {
index 1cc9e4f..128bd0e 100644 (file)
@@ -1,7 +1,12 @@
 <?php
+/**
+ *
+ */
 
-function wfSpecialVersion()
-{
+/**
+ * constructor
+ */
+function wfSpecialVersion() {
        global $wgUser, $wgOut, $wgVersion;
        $fname = "wfSpecialVersion";
 
@@ -39,7 +44,7 @@ function wfSpecialVersion()
                "[http://www.mysql.com/ MySQL]" => mysql_get_server_info()
        );
        
-       $out = "";
+       $out = '';
        foreach( $versions as $module => $ver ) {
                $out .= ":$module: $ver\n";
        }
index 15448ee..0b7847f 100644 (file)
@@ -1,10 +1,15 @@
 <?php
+/**
+ *
+ */
 
-function wfSpecialVote()
-{
+/**
+ * @todo code this feature !
+ */
+function wfSpecialVote() {
        global $wgUser, $wgOut;
 
-       $wgOut->addHTML( "<p>(TODO: Vote)" );
+       $wgOut->addHTML( '<p>(TODO: Vote)' );
 }
 
 ?>
index 95e65b6..6369e16 100644 (file)
@@ -1,11 +1,20 @@
 <?php
+/**
+ *
+ */
 
-require_once ( "QueryPage.php" ) ;
+/**
+ *
+ */
+require_once ( 'QueryPage.php' ) ;
 
+/**
+ *
+ */
 class WantedPagesPage extends QueryPage {
 
        function getName() {
-               return "Wantedpages";
+               return 'Wantedpages';
        }
 
        function isExpensive() {
@@ -44,8 +53,10 @@ class WantedPagesPage extends QueryPage {
        }
 }
 
-function wfSpecialWantedpages()
-{
+/**
+ * constructor
+ */
+function wfSpecialWantedpages() {
        list( $limit, $offset ) = wfCheckLimits();
 
        $wpp = new WantedPagesPage();
index 0518dc9..a84ad5e 100644 (file)
@@ -1,9 +1,18 @@
 <?php
+/**
+ *
+ */
+
+/**
+ *
+ */
 require_once( "SpecialRecentchanges.php" );
 require_once( "WatchedItem.php" );
 
-function wfSpecialWatchlist()
-{
+/**
+ * constructor
+ */
+function wfSpecialWatchlist() {
        global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc, $wgRequest;
        global $wgUseWatchlistCache, $wgWLCacheTimeout, $wgDBname;
        $fname = "wfSpecialWatchlist";
index 92a4931..b0c925a 100644 (file)
@@ -1,7 +1,12 @@
 <?php
-
-function wfSpecialWhatlinkshere($par = NULL)
-{
+/**
+ *
+ */
+
+/**
+ *
+ */
+function wfSpecialWhatlinkshere($par = NULL) {
        global $wgUser, $wgOut, $wgRequest;
        $fname = "wfSpecialWhatlinkshere";
 
@@ -64,8 +69,10 @@ function wfSpecialWhatlinkshere($par = NULL)
        }
 }
 
-function wfShowIndirectLinks( $level, $lid, $limit )
-{
+/**
+ *
+ */
+function wfShowIndirectLinks( $level, $lid, $limit ) {
        global $wgOut, $wgUser;
        $fname = "wfShowIndirectLinks";
 
index d0a2424..b46a86e 100644 (file)
@@ -1,6 +1,11 @@
 <?php
-# See deferred.doc
+/**
+ * See deferred.doc
+ */
 
+/**
+ *
+ */
 class SquidUpdate {
        var $urlArr, $mMaxTitles;
 
index 8e06b75..22c1870 100644 (file)
@@ -1,16 +1,22 @@
 <?php
-# See title.doc
-
+/**
+ * See title.doc
+ *
+ */
+
+/**
+ *
+ */
 $wgTitleInterwikiCache = array();
-
-# Title class
-# 
-# * Represents a title, which may contain an interwiki designation or namespace
-# * Can fetch various kinds of data from the database, albeit inefficiently. 
-#
-
 define ( 'GAID_FOR_UPDATE', 1 );
 
+/**
+ * Title class
+ * - Represents a title, which may contain an interwiki designation or namespace
+ * - Can fetch various kinds of data from the database, albeit inefficiently. 
+ *
+ * @todo migrate comments to phpdoc format
+*/
 class Title {
        # All member variables should be considered private
        # Please use the accessor functions
index f281617..c40560e 100644 (file)
@@ -1,4 +1,11 @@
 <?php
+/**
+ *
+ */
+
+/**
+ *
+ */
 class Tokenizer {
        /* private */ var $mText,               # Text to be processed by the tokenizer
                          $mPos,                # current position of tokenizer in text
@@ -6,8 +13,11 @@ class Tokenizer {
                          $mQueuedToken;        # Tokens that were already found, but not
                                                # returned yet.
 
-       /* private */ function Tokenizer()
-       {
+       /**
+        * Constructor
+        * @access private
+        */
+       function Tokenizer() {
                global $wgLang;
 
                $this->mPos=0;
@@ -15,9 +25,10 @@ class Tokenizer {
                $this->linkPrefixExtension = $wgLang->linkPrefixExtension();
        }
 
-       # factory function
-       function newFromString( $s )
-       {
+       /**
+        * factory function
+        */
+       function newFromString( $s ) {
                $fname = 'Tokenizer::newFromString';
                wfProfileIn( $fname );
 
@@ -30,13 +41,14 @@ class Tokenizer {
        }
 
 
-       // Return the next token, but do not increase the pointer. The next call
-       // to previewToken or nextToken will return the same token again.
-       // Actually, the pointer is increased, but the token is queued. The next
-       // call to previewToken or nextToken will check the queue and return
-       // the stored token.
-       function previewToken()
-       {
+       /**
+        * Return the next token, but do not increase the pointer. The next call
+        * to previewToken or nextToken will return the same token again.
+        * Actually, the pointer is increased, but the token is queued. The next
+        * call to previewToken or nextToken will check the queue and return
+        * the stored token.
+        */
+       function previewToken() {
                $fname = 'Tokenizer::previewToken';
                wfProfileIn( $fname );
 
@@ -53,13 +65,15 @@ class Tokenizer {
        }
 
 
-       // get the next token
-       // proceeds character by character through the text, looking for characters needing
-       // special attention. Those are currently: I, R, ', [, ], newline
-       //
-       // TODO:  handling of French blanks not yet implemented
-       function nextToken()
-       {
+       /**
+        * Get the next token.
+        *
+        * proceeds character by character through the text, looking for characters needing
+        * special attention. Those are currently: I, R, ', [, ], newline
+        *
+        * @todo handling of French blanks not yet implemented
+        */
+       function nextToken() {
                $fname = 'Tokenizer::nextToken';
                wfProfileIn( $fname );
 
@@ -256,10 +270,14 @@ class Tokenizer {
                return $token;
        }
 
-       // function continues
-       // checks whether the mText continues with $cont from mPos+1
-       /* private */ function continues( $cont )
-       {
+       /**
+        * function continues
+        *
+        * checks whether the mText continues with $cont from mPos+1
+        *
+        * @access private
+        */
+       function continues( $cont ) {
                // If string is not long enough to contain $cont, return false
                if ( $this->mTextLength < $this->mPos + strlen( $cont ) )
                        return false;
@@ -271,10 +289,14 @@ class Tokenizer {
                return true;
        }
 
-       // function preceeded
-       // checks whether the mText is preceeded by $prec at position mPos
-       /* private */ function preceeded( $prec )
-       {
+       /**
+        * function preceeded
+        *
+        * checks whether the mText is preceeded by $prec at position mPos
+        *
+        * @access private
+        */
+       function preceeded( $prec ) {
                $len = strlen( $prec );
                // if $prec is longer than the text up to mPos, return false
                if ( $this->mPos < $len )
@@ -282,8 +304,10 @@ class Tokenizer {
                return ( 0 == strcmp( $prec, substr($this->mText, $this->mPos-$len, $len) ) );
        }
 
-       function readAllUntil( $border )
-       {
+       /**
+        *
+        */
+       function readAllUntil( $border ) {
                $n = strpos( $this->mText, $border, $this->mPos );
                if ( $n === false )
                        return '';
index b36c569..2a644c8 100644 (file)
@@ -1,5 +1,12 @@
 <?php
-# See deferred.doc
+/**
+ * See deferred.doc
+ *
+ */
+
+/**
+ *
+ */
 require_once( 'UserUpdate.php' );
 require_once( 'ViewCountUpdate.php' );
 require_once( 'SiteStatsUpdate.php' );
index 4cbc03f..c7610d5 100644 (file)
@@ -1,8 +1,17 @@
 <?php
-# See user.doc
-
+/**
+ * See user.doc
+ *
+ */
+
+/**
+ *
+ */
 require_once( 'WatchedItem.php' );
 
+/**
+ *
+ */
 class User {
        /* private */ var $mId, $mName, $mPassword, $mEmail, $mNewtalk;
        /* private */ var $mRights, $mOptions;
@@ -18,8 +27,10 @@ class User {
                $this->loadDefaults();
        }
 
-       # Static factory method
-       #
+       /**
+        * Static factory method
+        * @static
+        */
        function newFromName( $name ) {
                $u = new User();
 
@@ -30,17 +41,26 @@ class User {
                return $u;
        }
 
-       /* static */ function whoIs( $id )      {
+       /**
+        * @static
+        */
+       function whoIs( $id )   {
                $dbr =& wfGetDB( DB_SLAVE );
                return $dbr->getField( 'user', 'user_name', array( 'user_id' => $id ) );
        }
 
-       /* static */ function whoIsReal( $id )  {
+       /**
+        * @static
+        */
+       function whoIsReal( $id )       {
                $dbr =& wfGetDB( DB_SLAVE );
                return $dbr->getField( 'user', 'user_real_name', array( 'user_id' => $id ) );
        }
 
-       /* static */ function idFromName( $name ) {
+       /**
+        * @static
+        */
+       function idFromName( $name ) {
                $fname = "User::idFromName";
 
                $nt = Title::newFromText( $name );
@@ -58,13 +78,18 @@ class User {
                }
        }
 
-       # does the string match an anonymous user IP address?
-       /* static */ function isIP( $name ) {
+       /**
+        * does the string match an anonymous user IP address?
+        * @static
+        */
+       function isIP( $name ) {
                return preg_match("/^\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3}$/",$name);
-
        }
 
-       /* static */ function randomPassword() {
+       /**
+        * static
+        */
+       function randomPassword() {
                $pwchars = 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz';
                $l = strlen( $pwchars ) - 1;
 
@@ -75,6 +100,9 @@ class User {
                return $np;
        }
 
+       /**
+        *
+        */
        function loadDefaults() {
                global $wgLang, $wgIP;
                global $wgNamespacesToBeSearchedDefault;
@@ -99,8 +127,10 @@ class User {
                $this->mHash = false;
        }
 
-       /* private */ function getBlockedStatus()
-       {
+       /**
+        * @access private
+        */
+       function getBlockedStatus() {
                global $wgIP, $wgBlockCache, $wgProxyList;
 
                if ( -1 != $this->mBlockedby ) { return; }
@@ -134,8 +164,7 @@ class User {
                }
        }
 
-       function isBlocked()
-       {
+       function isBlocked() {
                $this->getBlockedStatus();
                if ( 0 === $this->mBlockedby ) { return false; }
                return true;
@@ -165,8 +194,10 @@ class User {
                @session_start();
        }
 
-       /* static */ function loadFromSession()
-       {
+       /**
+        * @static
+        */
+       function loadFromSession() {
                global $wgMemc, $wgDBname;
 
                if ( isset( $_SESSION['wsUserID'] ) ) {
@@ -224,8 +255,10 @@ class User {
                return new User(); # Can't log in from session
        }
 
-       function loadFromDatabase()
-       {
+       /**
+        *
+        */
+       function loadFromDatabase() {
                global $wgCommandLineMode;
                $fname = "User::loadFromDatabase";
                if ( $this->mDataLoaded || $wgCommandLineMode ) {
@@ -434,8 +467,10 @@ class User {
                return in_array( 'bot', $this->mRights );
        }
 
-       # Load a skin if it doesn't exist or return it
-       # FIXME : need to check the old failback system [AV]
+       /**
+        * Load a skin if it doesn't exist or return it
+        * @todo FIXME : need to check the old failback system [AV]
+        */
        function &getSkin() {
                global $IP, $wgUsePHPTal;
                if ( ! isset( $this->mSkin ) ) {
@@ -502,7 +537,10 @@ class User {
        }
 
 
-       /* private */ function encodeOptions() {
+       /**
+        * @access private
+        */
+       function encodeOptions() {
                $a = array();
                foreach ( $this->mOptions as $oname => $oval ) {
                        array_push( $a, $oname.'='.$oval );
@@ -511,7 +549,10 @@ class User {
                return $s;
        }
 
-       /* private */ function decodeOptions( $str ) {
+       /**
+        * @access private
+        */
+       function decodeOptions( $str ) {
                $a = explode( "\n", $str );
                foreach ( $a as $s ) {
                        if ( preg_match( "/^(.[^=]*)=(.*)$/", $s, $m ) ) {
@@ -584,8 +625,9 @@ class User {
                $wgMemc->delete( "$wgDBname:user:id:$this->mId" );
        }
 
-       # Checks if a user with the given name exists, returns the ID
-       #
+       /**
+        * Checks if a user with the given name exists, returns the ID
+        */
        function idForName() {
                $fname = 'User::idForName';
 
@@ -626,8 +668,7 @@ class User {
                                
        }
 
-       function spreadBlock()
-       {
+       function spreadBlock() {
                global $wgIP;
                # If the (non-anonymous) user is blocked, this function will block any IP address
                # that they successfully log on from.
@@ -672,7 +713,7 @@ class User {
 
        }
 
-       function getPageRenderingHash(){
+       function getPageRenderingHash() {
                if( $this->mHash ){
                        return $this->mHash;
                }
@@ -705,10 +746,11 @@ class User {
                return $allowed;
        }
 
-       # Set mDataLoaded, return previous value
-       # Use this to prevent DB access in command-line scripts or similar situations
-       function setLoaded( $loaded )
-       {
+       /**
+        * Set mDataLoaded, return previous value
+        * Use this to prevent DB access in command-line scripts or similar situations
+        */
+       function setLoaded( $loaded ) {
                return wfSetVar( $this->mDataLoaded, $loaded );
        }
 
@@ -716,7 +758,10 @@ class User {
                return Title::makeTitle( NS_USER, $this->mName );
        }
 
-       /* static */ function getMaxID() {
+       /**
+        * @static
+        */
+       function getMaxID() {
                $dbr =& wfGetDB( DB_SLAVE );
                return $dbr->selectField( 'user', 'max(user_id)', false );
        }
@@ -725,7 +770,9 @@ class User {
                return $this->mId > User::getMaxID() * 0.99 && !$this->isSysop() && !$this->isBot() || $this->getID() == 0;
        }
 
-       # Check to see if the given clear-text password is one of the accepted passwords
+       /**
+        * Check to see if the given clear-text password is one of the accepted passwords
+        */
        function checkPassword( $password ) {
                $this->loadFromDatabase();
                $ep = $this->encryptPassword( $password );
index ff9b978..90ce059 100644 (file)
@@ -1,11 +1,21 @@
 <?php
+/**
+ * Provide mail capabilities
+ *
+ */
 
-# This function will perform a direct (authenticated) login to
-# a SMTP Server to use for mail relaying if 'wgSMTP' specifies an
-# array of parameters. It requires PEAR:Mail to do that.
-# Otherwise it just uses the standard PHP 'mail' function.
-function userMailer( $to, $from, $subject, $body )
-{
+/**
+ * This function will perform a direct (authenticated) login to
+ * a SMTP Server to use for mail relaying if 'wgSMTP' specifies an
+ * array of parameters. It requires PEAR:Mail to do that.
+ * Otherwise it just uses the standard PHP 'mail' function.
+ *
+ * @param string $to recipient's email
+ * @param string $from sender's email
+ * @param string $subject email's subject
+ * @param string $body email's text
+ */
+function userMailer( $to, $from, $subject, $body ) {
        global $wgUser, $wgSMTP, $wgOutputEncoding, $wgErrorString;
        
        $qto = wfQuotedPrintable( $to );
@@ -59,9 +69,11 @@ function userMailer( $to, $from, $subject, $body )
        }
 }
 
+/**
+ *
+ */
 function mailErrorHandler( $code, $string ) {
        global $wgErrorString;
        $wgErrorString = preg_replace( "/^mail\(\): /", "", $string );
 }
-
 ?>
index b314635..650c11a 100644 (file)
@@ -1,20 +1,23 @@
 <?php
-# See deferred.doc
+/**
+ * See deferred.doc
+ *
+ */
 
+/**
+ *
+ */
 class UserTalkUpdate {
 
        /* private */ var $mAction, $mNamespace, $mTitle;
 
-       function UserTalkUpdate( $action, $ns, $title )
-       {
+       function UserTalkUpdate( $action, $ns, $title ) {
                $this->mAction = $action;
                $this->mNamespace = $ns;
                $this->mTitle = str_replace( '_', ' ', $title );
        }
 
-       function doUpdate()
-       {
-       
+       function doUpdate() {   
                global $wgUser, $wgLang, $wgMemc, $wgDBname;
                $fname = 'UserTalkUpdate::doUpdate';
 
index bf8a33f..4d60a35 100644 (file)
@@ -1,12 +1,22 @@
 <?php
-# See deferred.doc
+/**
+ * See deferred.doc
+ *
+ */
 
+/**
+ *
+ */
 class UserUpdate {
-
+       /**
+        *
+        */
        function UserUpdate() { }
 
-       function doUpdate()
-       {
+       /**
+        *
+        */
+       function doUpdate() {
                global $wgUser;
                $wgUser->saveSettings();
        }
index 6ebe9af..add6af3 100644 (file)
@@ -1,12 +1,17 @@
 <?php
-# Simple 1:1 upper/lowercase switching arrays for utf-8 text
-# Won't get context-sensitive things yet
-
-# Hack for bugs in ucfirst() and company
-
-# These are pulled from memcached if possible, as this is faster than filling
-# up a big array manually. See also languages/LanguageUtf8.php
+/**
+ * Simple 1:1 upper/lowercase switching arrays for utf-8 text
+ * Won't get context-sensitive things yet
+ *
+ * Hack for bugs in ucfirst() and company
+ *
+ * These are pulled from memcached if possible, as this is faster than filling
+ * up a big array manually. See also languages/LanguageUtf8.php
+ */
 
+/*
+ * Translation array to get upper case character
+ */
 $wikiUpperChars = array(
        'a' => 'A',
        'b' => 'B',
@@ -755,6 +760,9 @@ $wikiUpperChars = array(
        '\xf0\x90\x91\x8d' => '\xf0\x90\x90\xa5'
 );
 
+/*
+ * Translation array to get lower case character
+ */
 $wikiLowerChars = array (
        'A' => 'a',
        'B' => 'b',
index 9b1c7ec..4cd573f 100644 (file)
@@ -1,17 +1,27 @@
 <?php
 # $Id$
-# See deferred.doc
+/**
+ * See deferred.doc
+ */
+
+/**
+ *
+ */
 class ViewCountUpdate {
 
        var $mPageID;
 
-       function ViewCountUpdate( $pageid )
-       {
+       /**
+        *
+        */
+       function ViewCountUpdate( $pageid ) {
                $this->mPageID = $pageid;
        }
 
-       function doUpdate()
-       {
+       /**
+        *
+        */
+       function doUpdate() {
                global $wgDisableCounters;
                if ( $wgDisableCounters ) { return; }
                $db =& wfGetDB( DB_MASTER );
index cc7a55e..bd47214 100644 (file)
@@ -1,5 +1,11 @@
 <?php
+/**
+ *
+ */
 
+/**
+ *
+ */
 class WatchedItem {
        var $mTitle, $mUser;
 
@@ -14,13 +20,17 @@ class WatchedItem {
                return $wl;
        }
 
-       # Returns the memcached key for this item
+       /**
+        * Returns the memcached key for this item
+        */
        function watchKey() {
                global $wgDBname;
                return "$wgDBname:watchlist:user:$this->id:page:$this->ns:$this->ti";
        }
        
-       # Is mTitle being watched by mUser?
+       /**
+        * Is mTitle being watched by mUser?
+        */
        function isWatched()
        {
                # Pages and their talk pages are considered equivalent for watching;
@@ -40,8 +50,7 @@ class WatchedItem {
                return $iswatched;
        }
 
-       function addWatch()
-       {
+       function addWatch() {
                $fname = "WatchedItem::addWatch";
                # REPLACE instead of INSERT because occasionally someone
                # accidentally reloads a watch-add operation.
@@ -58,8 +67,7 @@ class WatchedItem {
                return true;
        }
 
-       function removeWatch()
-       {
+       function removeWatch() {
                $fname = 'WatchedItem::removeWatch';
 
                $dbw =& wfGetDB( DB_MASTER );
@@ -80,7 +88,10 @@ class WatchedItem {
                }
        }
 
-       /* static */ function duplicateEntries( $ot, $nt ) {
+       /**
+        * @static
+        */
+       function duplicateEntries( $ot, $nt ) {
                $fname = "WatchedItem::duplicateEntries";
                global $wgMemc, $wgDBname;
                $oldnamespace = $ot->getNamespace() & ~1;
index 1ebc243..20f2c3e 100644 (file)
@@ -1,6 +1,8 @@
 <?php
-# Deal with importing all those nasssty globals and things
-# 
+/**
+ * Deal with importing all those nasssty globals and things
+ */
+
 # Copyright (C) 2003 Brion Vibber <brion@pobox.com>
 # http://www.mediawiki.org/
 # 
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
-# Hypothetically, we could use a WebRequest object to fake a
-# self-contained request (FauxRequest).
-
+/**
+ * Hypothetically, we could use a WebRequest object to fake a
+ * self-contained request (FauxRequest).
+ */
 class WebRequest {
        function WebRequest() {
                $this->checkMagicQuotes();
@@ -141,7 +144,9 @@ class WebRequest {
                return $wgServer . $this->getRequestURL();
        }
        
-       # Take an arbitrary query and rewrite the present URL to include it
+       /**
+        * Take an arbitrary query and rewrite the present URL to include it
+        */
        function appendQuery( $query ) {
                global $wgTitle;
                $basequery = '';
@@ -178,6 +183,9 @@ class WebRequest {
        }
 }
 
+/**
+ *
+ */
 class FauxRequest extends WebRequest {
        var $data = null;
        var $wasPosted = false;
index 625bad7..66d4fda 100644 (file)
@@ -1,7 +1,11 @@
 <?php
+/**
+ * Script to kill a MySQL thread after a specified timeout
+ */
 
-# Script to kill a MySQL thread after a specified timeout
-
+/**
+ *
+ */
 $wgCommandLineMode = true;
 
 unset( $IP );
index 1ed54c8..0b33e12 100644 (file)
@@ -1,15 +1,22 @@
 <?php
+/**
+ * Command line script to check for an open proxy at a specified location
+ */
 
-# Command line script to check for an open proxy at a specified location
-
-# Exit if there are not enough parameters, or if it's not command line mode
-
+/**
+ *
+ */
 $output = '';
+
+/**
+ * Exit if there are not enough parameters, or if it's not command line mode
+ */
 if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $argv ) < 4 ) {
        $output .= "Incorrect parameters\n";
 } else {
-
-       # Get parameters
+       /**
+        * Get parameters
+        */
        $ip = $argv[1];
        $port = $argv[2];
        $url = $argv[3];