/**
* 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 ) {
* The CDB hash function.
*
* @param $s
+ *
* @return
*/
public static function hash( $s ) {
unset( $this->handle );
}
+ /**
+ * @param $key
+ * @return bool|string
+ */
public function get( $key ) {
// strval is required
if ( $this->find( strval( $key ) ) ) {
$this->pos = $newpos;
}
+ /**
+ * @param $keylen
+ * @param $datalen
+ * @param $h
+ */
protected function addend( $keylen, $datalen, $h ) {
$this->hplist[] = array(
'h' => $h,
$this->write( $buf );
}
+ /**
+ * @throws MWException
+ */
protected function finish() {
// Hack for DBA cross-check
$this->hplist = array_reverse( $this->hplist );
/**
* 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;
/**
* Sets the location (cur_id) of the main object to which this object
* points
+ *
+ * @param $id int
*/
function setLocation( $id ) {
$this->mCurId = $id;
}
}
+ /**
+ * @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"
return $diff;
}
+ /**
+ * @param $base
+ * @param $diff
+ * @return bool|string
+ */
function patch( $base, $diff ) {
if ( function_exists( 'xdiff_string_bpatch' ) ) {
wfSuppressWarnings();
}
}
+ /**
+ * @return array
+ */
function __sleep() {
$this->compress();
if ( !count( $this->mItems ) ) {
/**
* 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
}
/**
+ * @param $wiki
+ *
* @return LoadBalancer_Single
*/
function newMainLB( $wiki = false ) {
}
/**
+ * @param $wiki
+ *
* @return LoadBalancer_Single
*/
function getMainLB( $wiki = false ) {
}
/**
+ * @param $cluster
+ * @param $wiki
+ *
* @return LoadBalancer_Single
*/
function newExternalLB( $cluster, $wiki = false ) {
}
/**
+ * @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 ) );
}
*/
var $db;
+ /**
+ * @param $params array
+ */
function __construct( $params ) {
$this->db = $params['connection'];
parent::__construct( array( 'servers' => array( array(
* @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 );
}
/**
* 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 );
$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();
* 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 ) {
* Browsers don't support TIFF inline generally...
* For inline display, we need to convert to PNG.
*
+ * @param $file
+ *
* @return bool
*/
function mustRender( $file ) {
}
/**
- * @param $ext
- * @param $mime
- * @param null $params
+ * @param $ext
+ * @param $mime
+ * @param $params
* @return bool
*/
function getThumbType( $ext, $mime, $params = null ) {
* 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.
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;
+ }
}
/**
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
* @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 );
/**
*/
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 );
/**
* Create a child frame
*
+ * @param $args array
+ * @param $title Title
+ *
* @return PPFrame
*/
function newChild( $args = false, $title = false );
/**
* Returns true if there are no arguments in this frame
+ *
+ * @return bool
*/
function isEmpty();
/**
* Returns true if the infinite loop check is OK, false if a loop is detected
+ *
+ * @return bool
*/
function loopCheck( $title );