And even more documentation, the last of this batch
authorSam Reed <reedy@users.mediawiki.org>
Sat, 28 May 2011 19:00:01 +0000 (19:00 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 28 May 2011 19:00:01 +0000 (19:00 +0000)
24 files changed:
includes/PoolCounter.php
includes/Revision.php
includes/WatchedItem.php
includes/WebStart.php
includes/parser/ParserOutput.php
includes/parser/Preprocessor.php
includes/parser/StripState.php
includes/search/SearchIBM_DB2.php
includes/search/SearchMssql.php
includes/search/SearchMySQL.php
includes/search/SearchOracle.php
includes/search/SearchPostgres.php
includes/search/SearchSqlite.php
includes/specials/SpecialDisambiguations.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialMostlinkedcategories.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialUploadStash.php
includes/specials/SpecialWhatlinkshere.php
includes/upload/UploadBase.php
includes/upload/UploadFromFile.php
includes/upload/UploadFromStash.php

index 302587d..182520e 100644 (file)
@@ -67,6 +67,11 @@ abstract class PoolCounter {
        
        /**
         * Create a Pool counter. This should only be called from the PoolWorks.
+        *
+        * @param $type
+        * @param $key
+        *
+        * @return PoolCounter
         */
        public static function factory( $type, $key ) {
                global $wgPoolCounterConf;
@@ -88,18 +93,28 @@ abstract class PoolCounter {
 }
 
 class PoolCounter_Stub extends PoolCounter {
+
+       /**
+        * @return Status
+        */
        function acquireForMe() {
                return Status::newGood( PoolCounter::LOCKED );
        }
 
+       /**
+        * @return Status
+        */
        function acquireForAnyone() {
                return Status::newGood( PoolCounter::LOCKED );
        }
 
+       /**
+        * @return Status
+        */
        function release() {
                return Status::newGood( PoolCounter::RELEASED );
        }
-       
+
        public function __construct() {
                /* No parameters needed */
        }
index 61a837e..66501d2 100644 (file)
@@ -66,6 +66,8 @@ class Revision {
         * Make a fake revision object from an archive table row. This is queried
         * for permissions or even inserted (as in Special:Undelete)
         * @todo FIXME: Should be a subclass for RevisionDelete. [TS]
+        *
+        * @return Revision
         */
        public static function newFromArchiveRow( $row, $overrides = array() ) {
                $attribs = $overrides + array(
index dd6e247..031b2b4 100644 (file)
@@ -133,6 +133,11 @@ class WatchedItem {
 
        /**
         * Handle duplicate entries. Backend for duplicateEntries().
+        *
+        * @param $ot Title
+        * @param $nt Title
+        *
+        * @return bool
         */
        private static function doDuplicateEntries( $ot, $nt ) {        
                $oldnamespace = $ot->getNamespace();
index 604f79f..feb8039 100644 (file)
@@ -12,6 +12,8 @@
  * Detect compiled mode by looking for a function that only exists if compiled 
  * in. Note that we can't use function_exists(), because it is terribly broken 
  * under HipHop due to the "volatile" feature.
+ *
+ * @return bool
  */
 function wfDetectCompiledMode() {
        try {
index 39da818..b27d077 100644 (file)
@@ -21,10 +21,12 @@ class CacheTime {
 
        function containsOldMagic()          { return $this->mContainsOldMagic; }
        function setContainsOldMagic( $com ) { return wfSetVar( $this->mContainsOldMagic, $com ); }
-       
-       /** 
-        * setCacheTime() sets the timestamp expressing when the page has been rendered. 
+
+       /**
+        * setCacheTime() sets the timestamp expressing when the page has been rendered.
         * This doesn not control expiry, see updateCacheExpiry() for that!
+        * @param $t string
+        * @return string
         */
        function setCacheTime( $t )          { return wfSetVar( $this->mCacheTime, $t ); }
 
@@ -35,6 +37,8 @@ class CacheTime {
         * the new call has no effect. The value returned by getCacheExpiry is smaller
         * or equal to the smallest number that was provided as an argument to 
         * updateCacheExpiry().
+        *
+        * @param $seconds number
         */
        function updateCacheExpiry( $seconds ) { 
                $seconds = (int)$seconds;
index 1e9343b..d6328aa 100644 (file)
@@ -128,6 +128,8 @@ interface PPFrame {
        /**
         * Returns true if the infinite loop check is OK, false if a loop is detected
         *
+        * @param $title
+        *
         * @return bool
         */
        function loopCheck( $title );
index 0bf9e17..c7bd1e7 100644 (file)
@@ -22,15 +22,27 @@ class StripState {
 
        /**
         * Add a nowiki strip item
+        * @param $marker
+        * @param $value
         */
        function addNoWiki( $marker, $value ) {
                $this->addItem( 'nowiki', $marker, $value );
        }
 
+       /**
+        * @param $marker
+        * @param $value
+        */
        function addGeneral( $marker, $value ) {
                $this->addItem( 'general', $marker, $value );
        }
 
+       /**
+        * @throws MWException
+        * @param $type
+        * @param $marker
+        * @param $value
+        */
        protected function addItem( $type, $marker, $value ) {
                if ( !preg_match( $this->regex, $marker, $m ) ) {
                        throw new MWException( "Invalid marker: $marker" );
@@ -39,20 +51,37 @@ class StripState {
                $this->data[$type][$m[1]] = $value;
        }
 
+       /**
+        * @param $text
+        * @return mixed
+        */
        function unstripGeneral( $text ) {
                return $this->unstripType( 'general', $text );
        }
 
+       /**
+        * @param $text
+        * @return mixed
+        */
        function unstripNoWiki( $text ) {
                return $this->unstripType( 'nowiki', $text );
        }
 
+       /**
+        * @param  $text
+        * @return mixed
+        */
        function unstripBoth( $text ) {
                $text = $this->unstripType( 'general', $text );
                $text = $this->unstripType( 'nowiki', $text );
                return $text;
        }
 
+       /**
+        * @param $type
+        * @param $text
+        * @return mixed
+        */
        protected function unstripType( $type, $text ) {
                // Shortcut 
                if ( !count( $this->data[$type] ) ) {
@@ -67,6 +96,10 @@ class StripState {
                return $out;
        }
 
+       /**
+        * @param $m array
+        * @return array
+        */
        protected function unstripCallback( $m ) {
                if ( isset( $this->data[$this->tempType][$m[1]] ) ) {
                        return $this->data[$this->tempType][$m[1]];
@@ -78,6 +111,10 @@ class StripState {
        /**
         * Get a StripState object which is sufficient to unstrip the given text. 
         * It will contain the minimum subset of strip items necessary.
+        *
+        * @param $text string
+        *
+        * @return StripState
         */
        function getSubState( $text ) {
                $subState = new StripState( $this->prefix );
index 732573f..c02a009 100644 (file)
@@ -91,7 +91,7 @@ class SearchIBM_DB2 extends SearchEngine {
         * Return a LIMIT clause to limit results on the query.
         * @return String
         */
-       function queryLimit($sql) {
+       function queryLimit( $sql ) {
                return $this->db->limitResult($sql, $this->limit, $this->offset);
        }
 
index b74fd7b..ebf19d3 100644 (file)
@@ -91,8 +91,9 @@ class SearchMssql extends SearchEngine {
        /**
         * Return a LIMIT clause to limit results on the query.
         *
+        * @param $sql string
+        *
         * @return String
-        * @private
         */
        function queryLimit( $sql ) {
                return $this->db->limitResult( $sql, $this->limit, $this->offset );
@@ -103,7 +104,6 @@ class SearchMssql extends SearchEngine {
         * subclasses may define this though
         *
         * @return String
-        * @private
         */
        function queryRanking( $filteredTerm, $fulltext ) {
                return ' ORDER BY ftindex.[RANK] DESC'; // return ' ORDER BY score(1)';
@@ -115,7 +115,6 @@ class SearchMssql extends SearchEngine {
         *
         * @param $filteredTerm String
         * @param $fulltext Boolean
-        * @private
         */
        function getQuery( $filteredTerm, $fulltext ) {
                return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
@@ -124,7 +123,6 @@ class SearchMssql extends SearchEngine {
                        $this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
        }
 
-
        /**
         * Picks which field to index on, depending on what type of query.
         *
index 1a478d7..51c73b6 100644 (file)
@@ -43,6 +43,8 @@ class SearchMySQL extends SearchEngine {
        /** 
         * Parse the user's query and transform it into an SQL fragment which will 
         * become part of a WHERE clause
+        *
+        * @return string
         */
        function parseQuery( $filteredText, $fulltext ) {
                global $wgContLang;
index d9ad299..85337ca 100644 (file)
@@ -123,18 +123,22 @@ class SearchOracle extends SearchEngine {
 
        /**
         * Return a LIMIT clause to limit results on the query.
+        *
+        * @param string
+        *
         * @return String
         */
-       function queryLimit($sql) {
+       function queryLimit( $sql ) {
                return $this->db->limitResult($sql, $this->limit, $this->offset);
        }
 
        /**
         * Does not do anything for generic search engine
         * subclasses may define this though
+        *
         * @return String
         */
-       function queryRanking($filteredTerm, $fulltext) {
+       function queryRanking( $filteredTerm, $fulltext ) {
                return ' ORDER BY score(1)';
        }
 
index b0590d0..5fd7415 100644 (file)
@@ -70,6 +70,10 @@ class SearchPostgres extends SearchEngine {
        /**
         * Transform the user's search string into a better form for tsearch2
         * Returns an SQL fragment consisting of quoted text to search for.
+        *
+        * @param $term string
+        *
+        * @return string
         */
        function parseQuery( $term ) {
 
index 6accc31..d58b7b9 100644 (file)
  * @ingroup Search
  */
 class SearchSqlite extends SearchEngine {
+
+       /**
+        * @var DatabaseSqlite
+        */
+       protected $db;
+
        /**
         * Creates an instance of this class
         * @param $db DatabaseSqlite: database object
index adbae79..e62253b 100644 (file)
@@ -105,6 +105,7 @@ class DisambiguationsPage extends PageQueryPage {
         * Fetch links and cache their existence
         *
         * @param $db DatabaseBase
+        * @param $res
         */
        function preprocessResults( $db, $res ) {
                $batch = new LinkBatch;
@@ -120,7 +121,6 @@ class DisambiguationsPage extends PageQueryPage {
                }
        }
 
-
        function formatResult( $skin, $result ) {
                global $wgContLang;
                $title = Title::newFromID( $result->value );
index a53b581..47576e3 100644 (file)
@@ -25,9 +25,6 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
        /**
         * Main execution point
         *
-        * @param $user User
-        * @param $output OutputPage
-        * @param $request WebRequest
         * @param $mode int
         */
        public function execute( $mode ) {
index 8ae2d54..4009fe6 100644 (file)
@@ -59,7 +59,7 @@ class FileDuplicateSearchPage extends QueryPage {
 
        /**
         *
-        * @param Array of File objects $dupes
+        * @param $dupes Array of File objects
         */
        function showList( $dupes ) {
                global $wgUser, $wgOut;
index 623504d..7ecad85 100644 (file)
@@ -114,6 +114,8 @@ class LinkSearchPage extends QueryPage {
 
        /**
         * Return an appropriately formatted LIKE query and the clause
+        *
+        * @return array
         */
        static function mungeQuery( $query, $prot ) {
                $field = 'el_index';
index 242e26f..195282f 100644 (file)
@@ -54,6 +54,7 @@ class MostlinkedCategoriesPage extends QueryPage {
         * Fetch user page links and cache their existence
         *
         * @param $db DatabaseBase
+        * @param $res DatabaseResult
         */
        function preprocessResults( $db, $res ) {
                $batch = new LinkBatch;
index 51528bc..e347894 100644 (file)
@@ -70,6 +70,8 @@ class SpecialProtectedtitles extends SpecialPage {
 
        /**
         * Callback function to output a restriction
+        *
+        * @return string
         */
        function formatRow( $row ) {
                global $wgUser, $wgLang;
index f262c0a..de0057f 100644 (file)
@@ -133,13 +133,12 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                return array( 'file' => $file, 'type' => $type );
        }
 
-
-
-
        /**
         * Get a thumbnail for file, either generated locally or remotely, and stream it out
-        * @param String $key: key for the file in the stash
-        * @param int $width: width of desired thumbnail
+        *
+        * @param $file
+        * @param $params array
+        *
         * @return boolean success
         */
        private function outputThumbFromStash( $file, $params ) {
@@ -155,11 +154,8 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                } else {
                        $this->outputLocallyScaledThumb( $file, $params, $flags );
                }
-
-
        }
 
-
        /**
         * Scale a file (probably with a locally installed imagemagick, or similar) and output it to STDOUT.
         * @param $file: File object
index 8b4eeef..631315e 100644 (file)
@@ -98,7 +98,6 @@ class SpecialWhatLinksHere extends SpecialPage {
         * @param $limit  int     Number of entries to display
         * @param $from   Title   Display from this article ID
         * @param $back   Title   Display from this article ID at backwards scrolling
-        * @private
         */
        function showIndirectLinks( $level, $target, $limit, $from = 0, $back = 0 ) {
                global $wgMaxRedirectLinksRetrieved;
index ba8fc2a..d0f61e5 100644 (file)
@@ -102,6 +102,7 @@ abstract class UploadBase {
         * Create a form of UploadBase depending on wpSourceType and initializes it
         *
         * @param $request WebRequest
+        * @param $type
         */
        public static function createFromRequest( &$request, $type = null ) {
                $type = $type ? $type : $request->getVal( 'wpSourceType', 'File' );
index b094828..c2ab646 100644 (file)
@@ -25,23 +25,38 @@ class UploadFromFile extends UploadBase {
                        
                return $this->initialize( $desiredDestName, $upload );
        }
-       
+
        /**
         * Initialize from a filename and a WebRequestUpload
+        * @param $name
+        * @param $webRequestUpload
         */
        function initialize( $name, $webRequestUpload ) {
                $this->mUpload = $webRequestUpload;
                return $this->initializePathInfo( $name, 
                        $this->mUpload->getTempName(), $this->mUpload->getSize() );
        }
+
+       /**
+        * @param $request
+        * @return bool
+        */
        static function isValidRequest( $request ) {
                # Allow all requests, even if no file is present, so that an error
                # because a post_max_size or upload_max_filesize overflow
                return true;
        }
-       
-       public function getSourceType() { return 'file'; }
-       
+
+       /**
+        * @return string
+        */
+       public function getSourceType() {
+               return 'file';
+       }
+
+       /**
+        * @return array
+        */
        public function verifyUpload() {
                # Check for a post_max_size or upload_max_size overflow, so that a 
                # proper error can be shown to the user
index 50974c3..2ceea0d 100644 (file)
@@ -82,8 +82,9 @@ class UploadFromStash extends UploadBase {
         * There is no need to stash the image twice
         */
        public function stashSession( $key = null ) {
-               if ( !empty( $this->mSessionKey ) )
+               if ( !empty( $this->mSessionKey ) ) {
                        return $this->mSessionKey;
+               }
                return parent::stashSession();
        }