http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89061
Revision: 89061
Author: reedy
Date: 2011-05-28 18:58:51 +0000 (Sat, 28 May 2011)
Log Message:
-----------
And even more documentation
Modified Paths:
--------------
trunk/phase3/includes/Article.php
trunk/phase3/includes/Autopromote.php
trunk/phase3/includes/BacklinkCache.php
trunk/phase3/includes/Block.php
trunk/phase3/includes/Cdb.php
trunk/phase3/includes/ExternalStore.php
trunk/phase3/includes/Fallback.php
trunk/phase3/includes/actions/CreditsAction.php
trunk/phase3/includes/api/ApiBase.php
trunk/phase3/includes/api/ApiQueryStashImageInfo.php
trunk/phase3/includes/api/ApiQueryUserContributions.php
trunk/phase3/includes/api/ApiUpload.php
trunk/phase3/includes/cache/HTMLCacheUpdate.php
trunk/phase3/includes/cache/LinkBatch.php
trunk/phase3/includes/cache/LinkCache.php
trunk/phase3/includes/conf/DatabaseConf.php
trunk/phase3/includes/db/DatabaseSqlite.php
trunk/phase3/includes/db/LBFactory.php
trunk/phase3/includes/db/LBFactory_Multi.php
trunk/phase3/includes/db/LBFactory_Single.php
trunk/phase3/includes/db/LoadBalancer.php
trunk/phase3/includes/db/LoadMonitor.php
trunk/phase3/includes/filerepo/FileRepo.php
trunk/phase3/includes/filerepo/ForeignAPIRepo.php
Modified: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php 2011-05-28 18:57:27 UTC (rev 89060)
+++ trunk/phase3/includes/Article.php 2011-05-28 18:58:51 UTC (rev 89061)
@@ -76,7 +76,7 @@
/**
* Constructor and clear the article
- * @param $title Reference to a Title object.
+ * @param $title Title Reference to a Title object.
* @param $oldId Integer revision ID, null to fetch from request, zero
for current
*/
public function __construct( Title $title, $oldId = null ) {
Modified: trunk/phase3/includes/Autopromote.php
===================================================================
--- trunk/phase3/includes/Autopromote.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/Autopromote.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -40,7 +40,7 @@
* self::checkCondition for evaluation of the latter type.
*
* @param $cond Mixed: a condition, possibly containing other conditions
- * @param $user The user to check the conditions against
+ * @param $user User The user to check the conditions against
* @return bool Whether the condition is true
*/
private static function recCheckCondition( $cond, User $user ) {
@@ -101,7 +101,7 @@
* ates them.
*
* @param $cond Array: A condition, which must not contain other
conditions
- * @param $user The user to check the condition against
+ * @param $user User The user to check the condition against
* @return bool Whether the condition is true for the user
*/
private static function checkCondition( $cond, User $user ) {
Modified: trunk/phase3/includes/BacklinkCache.php
===================================================================
--- trunk/phase3/includes/BacklinkCache.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/BacklinkCache.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -91,6 +91,8 @@
/**
* Set the Database object to use
+ *
+ * @param $db DatabaseBase
*/
public function setDB( $db ) {
$this->db = $db;
Modified: trunk/phase3/includes/Block.php
===================================================================
--- trunk/phase3/includes/Block.php 2011-05-28 18:57:27 UTC (rev 89060)
+++ trunk/phase3/includes/Block.php 2011-05-28 18:58:51 UTC (rev 89061)
@@ -122,7 +122,10 @@
/**
* Check if two blocks are effectively equal. Doesn't check irrelevant
things like
* the blocking user or the block timestamp, only things which affect
the blocked user *
- * @return Boolean
+ *
+ * @param $block Block
+ *
+ * @return bool
*/
public function equals( Block $block ) {
return (
Modified: trunk/phase3/includes/Cdb.php
===================================================================
--- trunk/phase3/includes/Cdb.php 2011-05-28 18:57:27 UTC (rev 89060)
+++ trunk/phase3/includes/Cdb.php 2011-05-28 18:58:51 UTC (rev 89061)
@@ -55,6 +55,8 @@
/**
* Get a value with a given key. Only string values are supported.
+ *
+ * @param $key string
*/
abstract public function get( $key );
}
Modified: trunk/phase3/includes/ExternalStore.php
===================================================================
--- trunk/phase3/includes/ExternalStore.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/ExternalStore.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -78,7 +78,7 @@
* Store a data item to an external store, identified by a partial URL
* The protocol part is used to identify the class, the rest is passed
to the
* class itself as a parameter.
- * @return The URL of the stored data item, or false on error
+ * @return string The URL of the stored data item, or false on error
*/
static function insert( $url, $data, $params = array() ) {
list( $proto, $params ) = explode( '://', $url, 2 );
@@ -97,7 +97,7 @@
*
* @param $data String
* @param $storageParams Array: associative array of parameters for the
ExternalStore object.
- * @return The URL of the stored data item, or false on error
+ * @return string The URL of the stored data item, or false on error
*/
public static function insertToDefault( $data, $storageParams = array()
) {
global $wgDefaultExternalStore;
@@ -136,7 +136,12 @@
}
}
- /** Like insertToDefault, but inserts on another wiki */
+ /**
+ * @param $data
+ * @param $wiki
+ *
+ * @return string
+ */
public static function insertToForeignDefault( $data, $wiki ) {
return self::insertToDefault( $data, array( 'wiki' => $wiki ) );
}
Modified: trunk/phase3/includes/Fallback.php
===================================================================
--- trunk/phase3/includes/Fallback.php 2011-05-28 18:57:27 UTC (rev 89060)
+++ trunk/phase3/includes/Fallback.php 2011-05-28 18:58:51 UTC (rev 89061)
@@ -37,8 +37,8 @@
return utf8_encode( $string );
}
return $string;
- }
-
+ }
+
/**
* Fallback implementation for mb_substr, hardcoded to UTF-8.
* Attempts to be at least _moderately_ efficient; best optimized
@@ -48,8 +48,14 @@
* Larger offsets are still fairly efficient for Latin text, but
* can be up to 100x slower than native if the text is heavily
* multibyte and we have to slog through a few hundred kb.
+ *
+ * @param $str
+ * @param $start
+ * @param $count string
+ *
+ * @return string
*/
- public static function mb_substr( $str, $start, $count='end' ) {
+ public static function mb_substr( $str, $start, $count = 'end' ) {
if( $start != 0 ) {
$split = self::mb_substr_split_unicode( $str, intval(
$start ) );
$str = substr( $str, $split );
Modified: trunk/phase3/includes/actions/CreditsAction.php
===================================================================
--- trunk/phase3/includes/actions/CreditsAction.php 2011-05-28 18:57:27 UTC
(rev 89060)
+++ trunk/phase3/includes/actions/CreditsAction.php 2011-05-28 18:58:51 UTC
(rev 89061)
@@ -51,8 +51,8 @@
}
/**
- * Get a list of contributors of $article
- * @param $article Article object
+ * Get a list of contributors
+ *
* @param $cnt Int: maximum list of contributors to show
* @param $showIfMax Bool: whether to contributors if there more than
$cnt
* @return String: html
Modified: trunk/phase3/includes/api/ApiBase.php
===================================================================
--- trunk/phase3/includes/api/ApiBase.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/api/ApiBase.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -123,7 +123,7 @@
/**
* Get the name of the module as shown in the profiler log
*
- * @param $db
+ * @param $db DatabaseBase
*
* @return string
*/
Modified: trunk/phase3/includes/api/ApiQueryStashImageInfo.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryStashImageInfo.php 2011-05-28
18:57:27 UTC (rev 89060)
+++ trunk/phase3/includes/api/ApiQueryStashImageInfo.php 2011-05-28
18:58:51 UTC (rev 89061)
@@ -95,7 +95,7 @@
/**
* Return the API documentation for the parameters.
- * @return {Array} parameter documentation.
+ * @return Array parameter documentation.
*/
public function getParamDescription() {
$p = $this->getModulePrefix();
Modified: trunk/phase3/includes/api/ApiQueryUserContributions.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryUserContributions.php 2011-05-28
18:57:27 UTC (rev 89060)
+++ trunk/phase3/includes/api/ApiQueryUserContributions.php 2011-05-28
18:58:51 UTC (rev 89061)
@@ -121,6 +121,8 @@
/**
* Validate the 'user' parameter and set the value to compare
* against `revision`.`rev_user_text`
+ *
+ * @param $user string
*/
private function prepareUsername( $user ) {
if ( !is_null( $user ) && $user !== '' ) {
Modified: trunk/phase3/includes/api/ApiUpload.php
===================================================================
--- trunk/phase3/includes/api/ApiUpload.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/api/ApiUpload.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -136,7 +136,7 @@
* Stash the file and return the session key
* Also re-raises exceptions with slightly more informative message
strings (useful for API)
* @throws MWException
- * @return {String} session key
+ * @return String session key
*/
function performStash() {
try {
Modified: trunk/phase3/includes/cache/HTMLCacheUpdate.php
===================================================================
--- trunk/phase3/includes/cache/HTMLCacheUpdate.php 2011-05-28 18:57:27 UTC
(rev 89060)
+++ trunk/phase3/includes/cache/HTMLCacheUpdate.php 2011-05-28 18:58:51 UTC
(rev 89061)
@@ -90,6 +90,8 @@
* Partition the current range given by $this->mStart and $this->mEnd,
* using a pre-calculated title array which gives the links in that
range.
* Queue the resulting jobs.
+ *
+ * @param $titleArray array
*/
protected function insertJobsFromTitles( $titleArray ) {
# We make subpartitions in the sense that the start of the
first job
Modified: trunk/phase3/includes/cache/LinkBatch.php
===================================================================
--- trunk/phase3/includes/cache/LinkBatch.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/cache/LinkBatch.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -27,14 +27,15 @@
* Use ->setCaller( __METHOD__ ) to indicate which code is using this
* class. Only used in debugging output.
* @since 1.17
+ *
+ * @param $caller
*/
public function setCaller( $caller ) {
$this->caller = $caller;
}
/**
- * @param $title Title
- * @return void
+ * @param $title Title
*/
public function addObj( $title ) {
if ( is_object( $title ) ) {
Modified: trunk/phase3/includes/cache/LinkCache.php
===================================================================
--- trunk/phase3/includes/cache/LinkCache.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/cache/LinkCache.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -34,11 +34,17 @@
/**
* General accessor to get/set whether SELECT FOR UPDATE should be used
+ *
+ * @return bool
*/
public function forUpdate( $update = null ) {
return wfSetVar( $this->mForUpdate, $update );
}
+ /**
+ * @param $title
+ * @return array|int
+ */
public function getGoodLinkID( $title ) {
if ( array_key_exists( $title, $this->mGoodLinks ) ) {
return $this->mGoodLinks[$title];
@@ -63,6 +69,10 @@
}
}
+ /**
+ * @param $title
+ * @return bool
+ */
public function isBadLink( $title ) {
return array_key_exists( $title, $this->mBadLinks );
}
Modified: trunk/phase3/includes/conf/DatabaseConf.php
===================================================================
--- trunk/phase3/includes/conf/DatabaseConf.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/conf/DatabaseConf.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -36,6 +36,11 @@
/**
* @see Conf::writeSetting()
+ *
+ * @param $name
+ * @param $value
+ *
+ * @return bool
*/
protected function writeSetting( $name, $value ) {
$dbw = wfGetDB( DB_MASTER );
Modified: trunk/phase3/includes/db/DatabaseSqlite.php
===================================================================
--- trunk/phase3/includes/db/DatabaseSqlite.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/db/DatabaseSqlite.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -27,6 +27,11 @@
/**
* Constructor.
* Parameters $server, $user and $password are not used.
+ * @param $server string
+ * @param $user string
+ * @param $password string
+ * @param $dbName string
+ * @param $flags int
*/
function __construct( $server = false, $user = false, $password =
false, $dbName = false, $flags = 0 ) {
$this->mName = $dbName;
@@ -58,6 +63,13 @@
/** Open an SQLite database and return a resource handle to it
* NOTE: only $dbName is used, the other parameters are irrelevant for
SQLite databases
+ *
+ * @param $server
+ * @param $user
+ * @param $pass
+ * @param $dbName
+ *
+ * @return PDO
*/
function open( $server, $user, $pass, $dbName ) {
global $wgSQLiteDataDir;
Modified: trunk/phase3/includes/db/LBFactory.php
===================================================================
--- trunk/phase3/includes/db/LBFactory.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/db/LBFactory.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -91,6 +91,8 @@
*
* @param $cluster String: external storage cluster, or false for core
* @param $wiki String: wiki ID, or false for the current wiki
+ *
+ * @return LoadBalancer
*/
abstract function newExternalLB( $cluster, $wiki = false );
@@ -99,6 +101,8 @@
*
* @param $cluster String: external storage cluster, or false for core
* @param $wiki String: wiki ID, or false for the current wiki
+ *
+ * @return LoadBalancer
*/
abstract function &getExternalLB( $cluster, $wiki = false );
Modified: trunk/phase3/includes/db/LBFactory_Multi.php
===================================================================
--- trunk/phase3/includes/db/LBFactory_Multi.php 2011-05-28 18:57:27 UTC
(rev 89060)
+++ trunk/phase3/includes/db/LBFactory_Multi.php 2011-05-28 18:58:51 UTC
(rev 89061)
@@ -99,7 +99,7 @@
}
/**
- * @param $wiki
+ * @param $wiki string
* @return LoadBalancer
*/
function newMainLB( $wiki = false ) {
Modified: trunk/phase3/includes/db/LBFactory_Single.php
===================================================================
--- trunk/phase3/includes/db/LBFactory_Single.php 2011-05-28 18:57:27 UTC
(rev 89060)
+++ trunk/phase3/includes/db/LBFactory_Single.php 2011-05-28 18:58:51 UTC
(rev 89061)
@@ -85,6 +85,10 @@
}
/**
+ *
+ * @param $server
+ * @param $dbNameOverride
+ *
* @return DatabaseBase
*/
function reallyOpenConnection( $server, $dbNameOverride = false ) {
Modified: trunk/phase3/includes/db/LoadBalancer.php
===================================================================
--- trunk/phase3/includes/db/LoadBalancer.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/db/LoadBalancer.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -948,6 +948,10 @@
/**
* Get lag time for each server
* Results are cached for a short time in memcached, and indefinitely
in the process cache
+ *
+ * @param $wiki
+ *
+ * @return array
*/
function getLagTimes( $wiki = false ) {
# Try process cache
Modified: trunk/phase3/includes/db/LoadMonitor.php
===================================================================
--- trunk/phase3/includes/db/LoadMonitor.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/db/LoadMonitor.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -47,6 +47,11 @@
/**
* Return an estimate of replication lag for each server
+ *
+ * @param $serverIndexes
+ * @param $wiki
+ *
+ * @return array
*/
function getLagTimes( $serverIndexes, $wiki );
}
Modified: trunk/phase3/includes/filerepo/FileRepo.php
===================================================================
--- trunk/phase3/includes/filerepo/FileRepo.php 2011-05-28 18:57:27 UTC (rev
89060)
+++ trunk/phase3/includes/filerepo/FileRepo.php 2011-05-28 18:58:51 UTC (rev
89061)
@@ -52,6 +52,10 @@
/**
* Determine if a string is an mwrepo:// URL
+ *
+ * @param $url string
+ *
+ * @return bool
*/
static function isVirtualUrl( $url ) {
return substr( $url, 0, 9 ) == 'mwrepo://';
@@ -93,7 +97,7 @@
* version control should return false if the time is specified.
*
* @param $title Mixed: Title object or string
- * @param $options Associative array of options:
+ * @param $options array Associative array of options:
* time: requested time for an archived image, or false
for the
* current version. An image object will be
returned which was
* created at the specified time.
@@ -103,6 +107,8 @@
* private: If true, return restricted (deleted) files if
the current
* user is allowed to view them. Otherwise, such
files will not
* be found.
+ *
+ * @return File|false
*/
function findFile( $title, $options = array() ) {
$time = isset( $options['time'] ) ? $options['time'] : false;
Modified: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
===================================================================
--- trunk/phase3/includes/filerepo/ForeignAPIRepo.php 2011-05-28 18:57:27 UTC
(rev 89060)
+++ trunk/phase3/includes/filerepo/ForeignAPIRepo.php 2011-05-28 18:58:51 UTC
(rev 89061)
@@ -75,6 +75,8 @@
/**
* Per docs in FileRepo, this needs to return false if we don't support
versioned
* files. Well, we don't.
+ *
+ * @return File
*/
function newFile( $title, $time = false ) {
if ( $time ) {
@@ -83,24 +85,30 @@
return parent::newFile( $title, $time );
}
-/**
- * No-ops
- */
+ /**
+ * No-ops
+ */
+
function storeBatch( $triplets, $flags = 0 ) {
return false;
}
+
function storeTemp( $originalName, $srcPath ) {
return false;
}
+
function append( $srcPath, $toAppendPath, $flags = 0 ){
return false;
}
+
function appendFinish( $toAppendPath ){
return false;
}
+
function publishBatch( $triplets, $flags = 0 ) {
return false;
}
+
function deleteBatch( $sourceDestPairs ) {
return false;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs