http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89049
Revision: 89049
Author: reedy
Date: 2011-05-28 17:51:33 +0000 (Sat, 28 May 2011)
Log Message:
-----------
And some more....
Modified Paths:
--------------
trunk/phase3/includes/Cdb_PHP.php
trunk/phase3/includes/HTMLForm.php
trunk/phase3/includes/HistoryBlob.php
trunk/phase3/includes/db/LBFactory_Single.php
trunk/phase3/includes/filerepo/ForeignDBFile.php
trunk/phase3/includes/media/Tiff.php
trunk/phase3/includes/parser/ParserOutput.php
trunk/phase3/includes/parser/Preprocessor.php
Modified: trunk/phase3/includes/Cdb_PHP.php
===================================================================
--- trunk/phase3/includes/Cdb_PHP.php 2011-05-28 17:32:17 UTC (rev 89048)
+++ trunk/phase3/includes/Cdb_PHP.php 2011-05-28 17:51:33 UTC (rev 89049)
@@ -16,6 +16,10 @@
/**
* Take a modulo of a signed integer as if it were an unsigned integer.
* $b must be less than 0x40000000 and greater than 0
+ *
+ * @param $a
+ * @param $b
+ *
* @return int
*/
public static function unsignedMod( $a, $b ) {
@@ -48,6 +52,7 @@
* The CDB hash function.
*
* @param $s
+ *
* @return
*/
public static function hash( $s ) {
@@ -116,6 +121,10 @@
unset( $this->handle );
}
+ /**
+ * @param $key
+ * @return bool|string
+ */
public function get( $key ) {
// strval is required
if ( $this->find( strval( $key ) ) ) {
@@ -327,6 +336,11 @@
$this->pos = $newpos;
}
+ /**
+ * @param $keylen
+ * @param $datalen
+ * @param $h
+ */
protected function addend( $keylen, $datalen, $h ) {
$this->hplist[] = array(
'h' => $h,
@@ -355,6 +369,9 @@
$this->write( $buf );
}
+ /**
+ * @throws MWException
+ */
protected function finish() {
// Hack for DBA cross-check
$this->hplist = array_reverse( $this->hplist );
Modified: trunk/phase3/includes/HTMLForm.php
===================================================================
--- trunk/phase3/includes/HTMLForm.php 2011-05-28 17:32:17 UTC (rev 89048)
+++ trunk/phase3/includes/HTMLForm.php 2011-05-28 17:51:33 UTC (rev 89049)
@@ -861,7 +861,7 @@
/**
* Initialise the object
- * @param $params Associative Array. See HTMLForm doc for syntax.
+ * @param $params array Associative Array. See HTMLForm doc for syntax.
*/
function __construct( $params ) {
$this->mParams = $params;
Modified: trunk/phase3/includes/HistoryBlob.php
===================================================================
--- trunk/phase3/includes/HistoryBlob.php 2011-05-28 17:32:17 UTC (rev
89048)
+++ trunk/phase3/includes/HistoryBlob.php 2011-05-28 17:51:33 UTC (rev
89049)
@@ -290,6 +290,8 @@
/**
* Sets the location (cur_id) of the main object to which this object
* points
+ *
+ * @param $id int
*/
function setLocation( $id ) {
$this->mCurId = $id;
@@ -482,6 +484,11 @@
}
}
+ /**
+ * @param $t1
+ * @param $t2
+ * @return string
+ */
function diff( $t1, $t2 ) {
# Need to do a null concatenation with warnings off, due to
bugs in the current version of xdiff
# "String is not zero-terminated"
@@ -491,6 +498,11 @@
return $diff;
}
+ /**
+ * @param $base
+ * @param $diff
+ * @return bool|string
+ */
function patch( $base, $diff ) {
if ( function_exists( 'xdiff_string_bpatch' ) ) {
wfSuppressWarnings();
@@ -561,6 +573,9 @@
}
}
+ /**
+ * @return array
+ */
function __sleep() {
$this->compress();
if ( !count( $this->mItems ) ) {
@@ -626,6 +641,8 @@
/**
* Helper function for compression jobs
* Returns true until the object is "full" and ready to be committed
+ *
+ * @return bool
*/
function isHappy() {
return $this->mSize < $this->mMaxSize
Modified: trunk/phase3/includes/db/LBFactory_Single.php
===================================================================
--- trunk/phase3/includes/db/LBFactory_Single.php 2011-05-28 17:32:17 UTC
(rev 89048)
+++ trunk/phase3/includes/db/LBFactory_Single.php 2011-05-28 17:51:33 UTC
(rev 89049)
@@ -15,6 +15,8 @@
}
/**
+ * @param $wiki
+ *
* @return LoadBalancer_Single
*/
function newMainLB( $wiki = false ) {
@@ -22,6 +24,8 @@
}
/**
+ * @param $wiki
+ *
* @return LoadBalancer_Single
*/
function getMainLB( $wiki = false ) {
@@ -29,6 +33,9 @@
}
/**
+ * @param $cluster
+ * @param $wiki
+ *
* @return LoadBalancer_Single
*/
function newExternalLB( $cluster, $wiki = false ) {
@@ -36,12 +43,19 @@
}
/**
+ * @param $cluster
+ * @param $wiki
+ *
* @return LoadBalancer_Single
*/
function &getExternalLB( $cluster, $wiki = false ) {
return $this->lb;
}
+ /**
+ * @param $callback string|array
+ * @param $params array
+ */
function forEachLB( $callback, $params = array() ) {
call_user_func_array( $callback, array_merge( array( $this->lb
), $params ) );
}
@@ -57,6 +71,9 @@
*/
var $db;
+ /**
+ * @param $params array
+ */
function __construct( $params ) {
$this->db = $params['connection'];
parent::__construct( array( 'servers' => array( array(
Modified: trunk/phase3/includes/filerepo/ForeignDBFile.php
===================================================================
--- trunk/phase3/includes/filerepo/ForeignDBFile.php 2011-05-28 17:32:17 UTC
(rev 89048)
+++ trunk/phase3/includes/filerepo/ForeignDBFile.php 2011-05-28 17:51:33 UTC
(rev 89049)
@@ -12,6 +12,13 @@
* @ingroup FileRepo
*/
class ForeignDBFile extends LocalFile {
+
+ /**
+ * @param $title
+ * @param $repo
+ * @param $unused
+ * @return ForeignDBFile
+ */
static function newFromTitle( $title, $repo, $unused = null ) {
return new self( $title, $repo );
}
@@ -19,6 +26,11 @@
/**
* Create a ForeignDBFile from a title
* Do not call this except from inside a repo class.
+ *
+ * @param $row
+ * @param $repo
+ *
+ * @return ForeignDBFile
*/
static function newFromRow( $row, $repo ) {
$title = Title::makeTitle( NS_FILE, $row->img_name );
@@ -35,21 +47,30 @@
$watch = false, $timestamp = false ) {
$this->readOnlyError();
}
+
function restore( $versions = array(), $unsuppress = false ) {
$this->readOnlyError();
}
+
function delete( $reason, $suppress = false ) {
$this->readOnlyError();
}
+
function move( $target ) {
$this->readOnlyError();
}
-
+
+ /**
+ * @return string
+ */
function getDescriptionUrl() {
// Restore remote behaviour
return File::getDescriptionUrl();
}
+ /**
+ * @return string
+ */
function getDescriptionText() {
// Restore remote behaviour
return File::getDescriptionText();
Modified: trunk/phase3/includes/media/Tiff.php
===================================================================
--- trunk/phase3/includes/media/Tiff.php 2011-05-28 17:32:17 UTC (rev
89048)
+++ trunk/phase3/includes/media/Tiff.php 2011-05-28 17:51:33 UTC (rev
89049)
@@ -17,6 +17,8 @@
* Conversion to PNG for inline display can be disabled here...
* Note scaling should work with ImageMagick, but may not with GD
scaling.
*
+ * @param $file
+ *
* @return bool
*/
function canRender( $file ) {
@@ -28,6 +30,8 @@
* Browsers don't support TIFF inline generally...
* For inline display, we need to convert to PNG.
*
+ * @param $file
+ *
* @return bool
*/
function mustRender( $file ) {
@@ -35,9 +39,9 @@
}
/**
- * @param $ext
- * @param $mime
- * @param null $params
+ * @param $ext
+ * @param $mime
+ * @param $params
* @return bool
*/
function getThumbType( $ext, $mime, $params = null ) {
Modified: trunk/phase3/includes/parser/ParserOutput.php
===================================================================
--- trunk/phase3/includes/parser/ParserOutput.php 2011-05-28 17:32:17 UTC
(rev 89048)
+++ trunk/phase3/includes/parser/ParserOutput.php 2011-05-28 17:51:33 UTC
(rev 89049)
@@ -26,9 +26,8 @@
* setCacheTime() sets the timestamp expressing when the page has been
rendered.
* This doesn not control expiry, see updateCacheExpiry() for that!
*/
- function setCacheTime( $t ) { return wfSetVar(
$this->mCacheTime, $t ); }
+ function setCacheTime( $t ) { return wfSetVar(
$this->mCacheTime, $t ); }
-
/**
* Sets the number of seconds after which this object should expire.
* This value is used with the ParserCache.
@@ -40,12 +39,14 @@
function updateCacheExpiry( $seconds ) {
$seconds = (int)$seconds;
- if ( $this->mCacheExpiry === null || $this->mCacheExpiry >
$seconds )
- $this->mCacheExpiry = $seconds;
+ if ( $this->mCacheExpiry === null || $this->mCacheExpiry >
$seconds ) {
+ $this->mCacheExpiry = $seconds;
+ }
// hack: set old-style marker for uncacheable entries.
- if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 )
+ if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 )
{
$this->mCacheTime = -1;
+ }
}
/**
@@ -59,28 +60,36 @@
function getCacheExpiry() {
global $wgParserCacheExpireTime;
- if ( $this->mCacheTime < 0 ) return 0; // old-style marker for
"not cachable"
+ if ( $this->mCacheTime < 0 ) {
+ return 0;
+ } // old-style marker for "not cachable"
$expire = $this->mCacheExpiry;
- if ( $expire === null )
+ if ( $expire === null ) {
$expire = $wgParserCacheExpireTime;
- else
+ } else {
$expire = min( $expire, $wgParserCacheExpireTime );
+ }
if( $this->containsOldMagic() ) { //compatibility hack
$expire = min( $expire, 3600 ); # 1 hour
}
- if ( $expire <= 0 ) return 0; // not cachable
- else return $expire;
+ if ( $expire <= 0 ) {
+ return 0; // not cachable
+ } else {
+ return $expire;
+ }
}
-
+ /**
+ * @return bool
+ */
function isCacheable() {
return $this->getCacheExpiry() > 0;
}
-
+
/**
* Return true if this cached output object predates the global or
* per-article cache invalidation timestamps, or if it comes from
Modified: trunk/phase3/includes/parser/Preprocessor.php
===================================================================
--- trunk/phase3/includes/parser/Preprocessor.php 2011-05-28 17:32:17 UTC
(rev 89048)
+++ trunk/phase3/includes/parser/Preprocessor.php 2011-05-28 17:51:33 UTC
(rev 89049)
@@ -9,7 +9,11 @@
* @ingroup Parser
*/
interface Preprocessor {
- /** Create a new preprocessor object based on an initialised Parser
object */
+ /**
+ * Create a new preprocessor object based on an initialised Parser
object
+ *
+ * @param $parser Parser
+ */
function __construct( $parser );
/**
@@ -28,12 +32,19 @@
*/
function newCustomFrame( $args );
- /** Create a new custom node for programmatic use of parameter
replacement as used in some extensions */
+ /**
+ * Create a new custom node for programmatic use of parameter
replacement as used in some extensions
+ *
+ * @param $values
+ */
function newPartNodeArray( $values );
/**
* Preprocess text to a PPNode
*
+ * @param $text
+ * @param $flags
+ *
* @return PPNode
*/
function preprocessToObj( $text, $flags = 0 );
@@ -54,6 +65,9 @@
/**
* Create a child frame
*
+ * @param $args array
+ * @param $title Title
+ *
* @return PPFrame
*/
function newChild( $args = false, $title = false );
@@ -86,6 +100,8 @@
/**
* Returns true if there are no arguments in this frame
+ *
+ * @return bool
*/
function isEmpty();
@@ -111,6 +127,8 @@
/**
* Returns true if the infinite loop check is OK, false if a loop is
detected
+ *
+ * @return bool
*/
function loopCheck( $title );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs