http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89063
Revision: 89063
Author: reedy
Date: 2011-05-28 19:00:01 +0000 (Sat, 28 May 2011)
Log Message:
-----------
And even more documentation, the last of this batch
Modified Paths:
--------------
trunk/phase3/includes/PoolCounter.php
trunk/phase3/includes/Revision.php
trunk/phase3/includes/WatchedItem.php
trunk/phase3/includes/WebStart.php
trunk/phase3/includes/parser/ParserOutput.php
trunk/phase3/includes/parser/Preprocessor.php
trunk/phase3/includes/parser/StripState.php
trunk/phase3/includes/search/SearchIBM_DB2.php
trunk/phase3/includes/search/SearchMssql.php
trunk/phase3/includes/search/SearchMySQL.php
trunk/phase3/includes/search/SearchOracle.php
trunk/phase3/includes/search/SearchPostgres.php
trunk/phase3/includes/search/SearchSqlite.php
trunk/phase3/includes/specials/SpecialDisambiguations.php
trunk/phase3/includes/specials/SpecialEditWatchlist.php
trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
trunk/phase3/includes/specials/SpecialLinkSearch.php
trunk/phase3/includes/specials/SpecialMostlinkedcategories.php
trunk/phase3/includes/specials/SpecialProtectedtitles.php
trunk/phase3/includes/specials/SpecialUploadStash.php
trunk/phase3/includes/specials/SpecialWhatlinkshere.php
trunk/phase3/includes/upload/UploadBase.php
trunk/phase3/includes/upload/UploadFromFile.php
trunk/phase3/includes/upload/UploadFromStash.php
Modified: trunk/phase3/includes/PoolCounter.php
===================================================================
--- trunk/phase3/includes/PoolCounter.php 2011-05-28 18:59:42 UTC (rev
89062)
+++ trunk/phase3/includes/PoolCounter.php 2011-05-28 19:00:01 UTC (rev
89063)
@@ -67,6 +67,11 @@
/**
* 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 @@
}
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 */
}
Modified: trunk/phase3/includes/Revision.php
===================================================================
--- trunk/phase3/includes/Revision.php 2011-05-28 18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/Revision.php 2011-05-28 19:00:01 UTC (rev 89063)
@@ -66,6 +66,8 @@
* 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(
Modified: trunk/phase3/includes/WatchedItem.php
===================================================================
--- trunk/phase3/includes/WatchedItem.php 2011-05-28 18:59:42 UTC (rev
89062)
+++ trunk/phase3/includes/WatchedItem.php 2011-05-28 19:00:01 UTC (rev
89063)
@@ -133,6 +133,11 @@
/**
* Handle duplicate entries. Backend for duplicateEntries().
+ *
+ * @param $ot Title
+ * @param $nt Title
+ *
+ * @return bool
*/
private static function doDuplicateEntries( $ot, $nt ) {
$oldnamespace = $ot->getNamespace();
Modified: trunk/phase3/includes/WebStart.php
===================================================================
--- trunk/phase3/includes/WebStart.php 2011-05-28 18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/WebStart.php 2011-05-28 19:00:01 UTC (rev 89063)
@@ -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 {
Modified: trunk/phase3/includes/parser/ParserOutput.php
===================================================================
--- trunk/phase3/includes/parser/ParserOutput.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/parser/ParserOutput.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -21,10 +21,12 @@
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 @@
* 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;
Modified: trunk/phase3/includes/parser/Preprocessor.php
===================================================================
--- trunk/phase3/includes/parser/Preprocessor.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/parser/Preprocessor.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -128,6 +128,8 @@
/**
* Returns true if the infinite loop check is OK, false if a loop is
detected
*
+ * @param $title
+ *
* @return bool
*/
function loopCheck( $title );
Modified: trunk/phase3/includes/parser/StripState.php
===================================================================
--- trunk/phase3/includes/parser/StripState.php 2011-05-28 18:59:42 UTC (rev
89062)
+++ trunk/phase3/includes/parser/StripState.php 2011-05-28 19:00:01 UTC (rev
89063)
@@ -22,15 +22,27 @@
/**
* 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 @@
$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 @@
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 @@
/**
* 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 );
Modified: trunk/phase3/includes/search/SearchIBM_DB2.php
===================================================================
--- trunk/phase3/includes/search/SearchIBM_DB2.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/search/SearchIBM_DB2.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -91,7 +91,7 @@
* 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);
}
Modified: trunk/phase3/includes/search/SearchMssql.php
===================================================================
--- trunk/phase3/includes/search/SearchMssql.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/search/SearchMssql.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -91,8 +91,9 @@
/**
* 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 @@
* 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 @@
*
* @param $filteredTerm String
* @param $fulltext Boolean
- * @private
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm,
$fulltext ) . ' ' .
@@ -124,7 +123,6 @@
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
}
-
/**
* Picks which field to index on, depending on what type of query.
*
Modified: trunk/phase3/includes/search/SearchMySQL.php
===================================================================
--- trunk/phase3/includes/search/SearchMySQL.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/search/SearchMySQL.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -43,6 +43,8 @@
/**
* 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;
Modified: trunk/phase3/includes/search/SearchOracle.php
===================================================================
--- trunk/phase3/includes/search/SearchOracle.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/search/SearchOracle.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -123,18 +123,22 @@
/**
* 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)';
}
Modified: trunk/phase3/includes/search/SearchPostgres.php
===================================================================
--- trunk/phase3/includes/search/SearchPostgres.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/search/SearchPostgres.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -70,6 +70,10 @@
/**
* 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 ) {
Modified: trunk/phase3/includes/search/SearchSqlite.php
===================================================================
--- trunk/phase3/includes/search/SearchSqlite.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/search/SearchSqlite.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -26,7 +26,13 @@
* @ingroup Search
*/
class SearchSqlite extends SearchEngine {
+
/**
+ * @var DatabaseSqlite
+ */
+ protected $db;
+
+ /**
* Creates an instance of this class
* @param $db DatabaseSqlite: database object
*/
Modified: trunk/phase3/includes/specials/SpecialDisambiguations.php
===================================================================
--- trunk/phase3/includes/specials/SpecialDisambiguations.php 2011-05-28
18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialDisambiguations.php 2011-05-28
19:00:01 UTC (rev 89063)
@@ -105,6 +105,7 @@
* Fetch links and cache their existence
*
* @param $db DatabaseBase
+ * @param $res
*/
function preprocessResults( $db, $res ) {
$batch = new LinkBatch;
@@ -120,7 +121,6 @@
}
}
-
function formatResult( $skin, $result ) {
global $wgContLang;
$title = Title::newFromID( $result->value );
Modified: trunk/phase3/includes/specials/SpecialEditWatchlist.php
===================================================================
--- trunk/phase3/includes/specials/SpecialEditWatchlist.php 2011-05-28
18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialEditWatchlist.php 2011-05-28
19:00:01 UTC (rev 89063)
@@ -25,9 +25,6 @@
/**
* Main execution point
*
- * @param $user User
- * @param $output OutputPage
- * @param $request WebRequest
* @param $mode int
*/
public function execute( $mode ) {
Modified: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
2011-05-28 18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
2011-05-28 19:00:01 UTC (rev 89063)
@@ -59,7 +59,7 @@
/**
*
- * @param Array of File objects $dupes
+ * @param $dupes Array of File objects
*/
function showList( $dupes ) {
global $wgUser, $wgOut;
Modified: trunk/phase3/includes/specials/SpecialLinkSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialLinkSearch.php 2011-05-28
18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialLinkSearch.php 2011-05-28
19:00:01 UTC (rev 89063)
@@ -114,6 +114,8 @@
/**
* Return an appropriately formatted LIKE query and the clause
+ *
+ * @return array
*/
static function mungeQuery( $query, $prot ) {
$field = 'el_index';
Modified: trunk/phase3/includes/specials/SpecialMostlinkedcategories.php
===================================================================
--- trunk/phase3/includes/specials/SpecialMostlinkedcategories.php
2011-05-28 18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialMostlinkedcategories.php
2011-05-28 19:00:01 UTC (rev 89063)
@@ -54,6 +54,7 @@
* Fetch user page links and cache their existence
*
* @param $db DatabaseBase
+ * @param $res DatabaseResult
*/
function preprocessResults( $db, $res ) {
$batch = new LinkBatch;
Modified: trunk/phase3/includes/specials/SpecialProtectedtitles.php
===================================================================
--- trunk/phase3/includes/specials/SpecialProtectedtitles.php 2011-05-28
18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialProtectedtitles.php 2011-05-28
19:00:01 UTC (rev 89063)
@@ -70,6 +70,8 @@
/**
* Callback function to output a restriction
+ *
+ * @return string
*/
function formatRow( $row ) {
global $wgUser, $wgLang;
Modified: trunk/phase3/includes/specials/SpecialUploadStash.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUploadStash.php 2011-05-28
18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialUploadStash.php 2011-05-28
19:00:01 UTC (rev 89063)
@@ -133,13 +133,12 @@
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 @@
} 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
Modified: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
===================================================================
--- trunk/phase3/includes/specials/SpecialWhatlinkshere.php 2011-05-28
18:59:42 UTC (rev 89062)
+++ trunk/phase3/includes/specials/SpecialWhatlinkshere.php 2011-05-28
19:00:01 UTC (rev 89063)
@@ -98,7 +98,6 @@
* @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;
Modified: trunk/phase3/includes/upload/UploadBase.php
===================================================================
--- trunk/phase3/includes/upload/UploadBase.php 2011-05-28 18:59:42 UTC (rev
89062)
+++ trunk/phase3/includes/upload/UploadBase.php 2011-05-28 19:00:01 UTC (rev
89063)
@@ -102,6 +102,7 @@
* 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' );
Modified: trunk/phase3/includes/upload/UploadFromFile.php
===================================================================
--- trunk/phase3/includes/upload/UploadFromFile.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/upload/UploadFromFile.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -25,23 +25,38 @@
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
Modified: trunk/phase3/includes/upload/UploadFromStash.php
===================================================================
--- trunk/phase3/includes/upload/UploadFromStash.php 2011-05-28 18:59:42 UTC
(rev 89062)
+++ trunk/phase3/includes/upload/UploadFromStash.php 2011-05-28 19:00:01 UTC
(rev 89063)
@@ -82,8 +82,9 @@
* 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();
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs