Change-Id: I09d0c13070f966fcf23d2638d8fc1328279a5995
48 files changed:
* @param string|null $deprecatedVersion Optionally, mark hook as deprecated with version number
* @return bool True if no handler aborted the hook
*
* @param string|null $deprecatedVersion Optionally, mark hook as deprecated with version number
* @return bool True if no handler aborted the hook
*
+ * @throws Exception
+ * @throws FatalError
+ * @throws MWException
* @since 1.22 A hook function is not required to return a value for
* processing to continue. Not returning a value (or explicitly
* returning null) is equivalent to returning true.
* @since 1.22 A hook function is not required to return a value for
* processing to continue. Not returning a value (or explicitly
* returning null) is equivalent to returning true.
- * @throws MWException
- * @throws FatalError
*/
public static function run( $event, array $args = array(), $deprecatedVersion = null ) {
$profiler = Profiler::instance();
*/
public static function run( $event, array $args = array(), $deprecatedVersion = null ) {
$profiler = Profiler::instance();
* @param string $type The type of selector (ID, CLASS, TAG_CLASS, or TAG)
* @param string $rawName The raw name of the selector
* @return bool Whether the selector was successfully recognised
* @param string $type The type of selector (ID, CLASS, TAG_CLASS, or TAG)
* @param string $rawName The raw name of the selector
* @return bool Whether the selector was successfully recognised
*/
protected function parseSelector( $selector, &$type, &$rawName ) {
if ( strpos( $selector, '.' ) === 0 ) {
*/
protected function parseSelector( $selector, &$type, &$rawName ) {
if ( strpos( $selector, '.' ) === 0 ) {
* @param string $text
* @param bool $linestart Is this the start of a line?
* @param bool $interface Is this text in the user interface language?
* @param string $text
* @param bool $linestart Is this the start of a line?
* @param bool $interface Is this text in the user interface language?
*/
public function addWikiText( $text, $linestart = true, $interface = true ) {
$title = $this->getTitle(); // Work around E_STRICT
*/
public function addWikiText( $text, $linestart = true, $interface = true ) {
$title = $this->getTitle(); // Work around E_STRICT
* @param string $token Supplied token
* @param array $params All supplied parameters for the module
* @return bool
* @param string $token Supplied token
* @param array $params All supplied parameters for the module
* @return bool
*/
final public function validateToken( $token, array $params ) {
$tokenType = $this->needsToken();
*/
final public function validateToken( $token, array $params ) {
$tokenType = $this->needsToken();
* @since 1.23
* @param Status $status
* @return array Array of code and error string
* @since 1.23
* @param Status $status
* @return array Array of code and error string
*/
public function getErrorFromStatus( $status ) {
if ( $status->isGood() ) {
*/
public function getErrorFromStatus( $status ) {
if ( $status->isGood() ) {
*
* @since 1.23
* @param Exception $e
*
* @since 1.23
* @param Exception $e
*/
public static function handleApiBeforeMainException( Exception $e ) {
ob_start();
*/
public static function handleApiBeforeMainException( Exception $e ) {
ob_start();
/**
* Set up the module for response
* @return ApiBase The module that will handle this action
/**
* Set up the module for response
* @return ApiBase The module that will handle this action
+ * @throws MWException
+ * @throws UsageException
*/
protected function setupModule() {
// Instantiate the module requested by the user
*/
protected function setupModule() {
// Instantiate the module requested by the user
*
* @param string $type MIME type
* @return string
*
* @param string $type MIME type
* @return string
*/
public static function getOpenSearchTemplate( $type ) {
global $wgOpenSearchTemplate, $wgCanonicalServer;
*/
public static function getOpenSearchTemplate( $type ) {
global $wgOpenSearchTemplate, $wgCanonicalServer;
* @param ApiBase $module
* @param string $paramName
* @param string|array $paramValue
* @param ApiBase $module
* @param string $paramName
* @param string|array $paramValue
*/
public function setContinueParam( ApiBase $module, $paramName, $paramValue ) {
$name = $module->getModuleName();
*/
public function setContinueParam( ApiBase $module, $paramName, $paramValue ) {
$name = $module->getModuleName();
* rules, and save the compiled rules in a process-local cache.
*
* @param string $fileName
* rules, and save the compiled rules in a process-local cache.
*
* @param string $fileName
*/
protected function loadPluralFile( $fileName ) {
// Use file_get_contents instead of DOMDocument::load (T58439)
*/
protected function loadPluralFile( $fileName ) {
// Use file_get_contents instead of DOMDocument::load (T58439)
* It should only consist of alphanumberic, '-', and '_' characters.
* This ID is what avoids collisions if multiple logical caches
* use the same storage system, so this should be set carefully.
* It should only consist of alphanumberic, '-', and '_' characters.
* This ID is what avoids collisions if multiple logical caches
* use the same storage system, so this should be set carefully.
*/
public function __construct( array $config ) {
$this->cacheID = $config['cacheId'];
*/
public function __construct( array $config ) {
$this->cacheID = $config['cacheId'];
/**
* @param IContextSource|Skin $obj
/**
* @param IContextSource|Skin $obj
*/
public function __construct( $obj ) {
if ( $obj instanceof Skin ) {
*/
public function __construct( $obj ) {
if ( $obj instanceof Skin ) {
*/
protected function getContentClass() {
throw new MWException( 'Subclass must override' );
*/
protected function getContentClass() {
throw new MWException( 'Subclass must override' );
/**
* @param string $text
* @param string $model_id
/**
* @param string $text
* @param string $model_id
*/
public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
parent::__construct( $model_id );
*/
public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
parent::__construct( $model_id );
/**
* Get the Language object.
* Initialization of user or request objects can depend on this.
/**
* Get the Language object.
* Initialization of user or request objects can depend on this.
* @since 1.19
*/
public function getLanguage() {
* @since 1.19
*/
public function getLanguage() {
* calling rollback when no transaction is in progress. This will silently
* break any ongoing explicit transaction. Only set the flush flag if you
* are sure that it is safe to ignore these warnings in your context.
* calling rollback when no transaction is in progress. This will silently
* break any ongoing explicit transaction. Only set the flush flag if you
* are sure that it is safe to ignore these warnings in your context.
+ * @throws DBUnexpectedError
* @since 1.23 Added $flush parameter
*/
final public function rollback( $fname = __METHOD__, $flush = '' ) {
* @since 1.23 Added $flush parameter
*/
final public function rollback( $fname = __METHOD__, $flush = '' ) {
* (optional) (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
* @return mixed Database result resource (feed to Database::fetchObject
* or whatever), or false on failure
* (optional) (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
* @return mixed Database result resource (feed to Database::fetchObject
* or whatever), or false on failure
+ * @throws DBQueryError
+ * @throws DBUnexpectedError
+ * @throws Exception
*/
public function select( $table, $vars, $conds = '', $fname = __METHOD__,
$options = array(), $join_conds = array()
*/
public function select( $table, $vars, $conds = '', $fname = __METHOD__,
$options = array(), $join_conds = array()
* @param array $arrToInsert
* @param string $fname
* @param array $options
* @param array $arrToInsert
* @param string $fname
* @param array $options
*/
public function insert( $table, $arrToInsert, $fname = __METHOD__, $options = array() ) {
# No rows to insert, easy just return now
*/
public function insert( $table, $arrToInsert, $fname = __METHOD__, $options = array() ) {
# No rows to insert, easy just return now
* @param string $fname
* @param array $insertOptions
* @param array $selectOptions
* @param string $fname
* @param array $insertOptions
* @param array $selectOptions
* @return null|ResultWrapper
* @return null|ResultWrapper
*/
public function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
$insertOptions = array(), $selectOptions = array()
*/
public function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
$insertOptions = array(), $selectOptions = array()
* - IGNORE: Ignore unique key conflicts
* - LOW_PRIORITY: MySQL-specific, see MySQL manual.
* @return bool
* - IGNORE: Ignore unique key conflicts
* - LOW_PRIORITY: MySQL-specific, see MySQL manual.
* @return bool
+ * @throws DBUnexpectedError
+ * @throws Exception
+ * @throws MWException
*/
function update( $table, $values, $conds, $fname = __METHOD__, $options = array() ) {
$table = $this->tableName( $table );
*/
function update( $table, $values, $conds, $fname = __METHOD__, $options = array() ) {
$table = $this->tableName( $table );
* @param int $limit The SQL limit
* @param bool|int $offset The SQL offset (default false)
* @return array|string
* @param int $limit The SQL limit
* @param bool|int $offset The SQL offset (default false)
* @return array|string
+ * @throws DBUnexpectedError
*/
public function limitResult( $sql, $limit, $offset = false ) {
if ( $offset === false || $offset == 0 ) {
*/
public function limitResult( $sql, $limit, $offset = false ) {
if ( $offset === false || $offset == 0 ) {
* @param array $options
* @param null|string $functionName
* @return ResultWrapper
* @param array $options
* @param null|string $functionName
* @return ResultWrapper
- * @throws DBQueryError If the query failed (even if the database was in
- * ignoreErrors mode).
+ * @throws Exception
+ * @throws MWException
*/
public function rawSelect( $fields = null, array $conditions = array(),
array $options = array(), $functionName = null
*/
public function rawSelect( $fields = null, array $conditions = array(),
array $options = array(), $functionName = null
* @param array $alldata
* @param array $params
* @return bool
* @param array $alldata
* @param array $params
* @return bool
*/
protected function isHiddenRecurse( array $alldata, array $params ) {
$origParams = $params;
*/
protected function isHiddenRecurse( array $alldata, array $params ) {
$origParams = $params;
* - reqTimeout : default request timeout
* - usePipelining : whether to use HTTP pipelining if possible (for all hosts)
* - maxConnsPerHost : maximum number of concurrent connections (per host)
* - reqTimeout : default request timeout
* - usePipelining : whether to use HTTP pipelining if possible (for all hosts)
* - maxConnsPerHost : maximum number of concurrent connections (per host)
*/
public function __construct( array $options ) {
if ( isset( $options['caBundlePath'] ) ) {
*/
public function __construct( array $options ) {
if ( isset( $options['caBundlePath'] ) ) {
* Execute a set of HTTP(S) requests concurrently
*
* The maps are returned by this method with the 'response' field set to a map of:
* Execute a set of HTTP(S) requests concurrently
*
* The maps are returned by this method with the 'response' field set to a map of:
- * - code : HTTP response code or 0 if there was a serious cURL error
- * - reason : HTTP response reason (empty if there was a serious cURL error)
- * - headers : <header name/value associative array>
- * - body : HTTP response body or resource (if "stream" was set)
+ * - code : HTTP response code or 0 if there was a serious cURL error
+ * - reason : HTTP response reason (empty if there was a serious cURL error)
+ * - headers : <header name/value associative array>
+ * - body : HTTP response body or resource (if "stream" was set)
* - error : Any cURL error string
* - error : Any cURL error string
- * The map also stores integer-indexed copies of these values. This lets callers do:
- * <code>
- * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $req['response'];
+ * The map also stores integer-indexed copies of these values. This lets callers do:
+ * <code>
+ * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $req['response'];
* </code>
* All headers in the 'headers' field are normalized to use lower case names.
* This is true for the request headers and the response headers. Integer-indexed
* </code>
* All headers in the 'headers' field are normalized to use lower case names.
* This is true for the request headers and the response headers. Integer-indexed
* - usePipelining : whether to use HTTP pipelining if possible
* - maxConnsPerHost : maximum number of concurrent connections (per host)
* @return array $reqs With response array populated for each
* - usePipelining : whether to use HTTP pipelining if possible
* - maxConnsPerHost : maximum number of concurrent connections (per host)
* @return array $reqs With response array populated for each
*/
public function runMulti( array $reqs, array $opts = array() ) {
$chm = $this->getCurlMulti();
*/
public function runMulti( array $reqs, array $opts = array() ) {
$chm = $this->getCurlMulti();
* - connTimeout : default connection timeout
* - reqTimeout : default request timeout
* @return resource
* - connTimeout : default connection timeout
* - reqTimeout : default request timeout
* @return resource
*/
protected function getCurlHandle( array &$req, array $opts = array() ) {
$ch = curl_init();
*/
protected function getCurlHandle( array &$req, array $opts = array() ) {
$ch = curl_init();
* - body : HTTP response body or resource (if "stream" was set)
* - error : Any cURL error string
* The map also stores integer-indexed copies of these values. This lets callers do:
* - body : HTTP response body or resource (if "stream" was set)
* - error : Any cURL error string
* The map also stores integer-indexed copies of these values. This lets callers do:
- * <code>
- * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $responses[0];
+ * <code>
+ * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $responses[0];
* </code>
*
* @param array $reqs Map of Virtual HTTP request maps
* @return array $reqs Map of corresponding response values with the same keys/order
* </code>
*
* @param array $reqs Map of Virtual HTTP request maps
* @return array $reqs Map of corresponding response values with the same keys/order
*/
public function runMulti( array $reqs ) {
foreach ( $reqs as $index => &$req ) {
*/
public function runMulti( array $reqs ) {
foreach ( $reqs as $index => &$req ) {
*
* @param File $file The DjVu file in question
* @return string XML metadata as a string.
*
* @param File $file The DjVu file in question
* @return string XML metadata as a string.
*/
private function getUnserializedMetadata( File $file ) {
$metadata = $file->getMetadata();
*/
private function getUnserializedMetadata( File $file ) {
$metadata = $file->getMetadata();
* @param mixed $value
* @param int $exptime
* @return bool
* @param mixed $value
* @param int $exptime
* @return bool
*/
public function cas( $casToken, $key, $value, $exptime = 0 ) {
// APC's CAS functions only work on integers
*/
public function cas( $casToken, $key, $value, $exptime = 0 ) {
// APC's CAS functions only work on integers
* values, but serialization is much slower unless the php.ini option
* igbinary.compact_strings is off.
* @param array $params
* values, but serialization is much slower unless the php.ini option
* igbinary.compact_strings is off.
* @param array $params
*/
function __construct( $params ) {
$params = $this->applyDefaultParams( $params );
*/
function __construct( $params ) {
$params = $this->applyDefaultParams( $params );
* @param mixed $value
* @param mixed $exptime
* @return bool
* @param mixed $value
* @param mixed $exptime
* @return bool
*/
public function cas( $casToken, $key, $value, $exptime = 0 ) {
throw new MWException( "CAS is not implemented in " . __CLASS__ );
*/
public function cas( $casToken, $key, $value, $exptime = 0 ) {
throw new MWException( "CAS is not implemented in " . __CLASS__ );
*
* @param int $serverIndex
* @return DatabaseBase
*
* @param int $serverIndex
* @return DatabaseBase
*/
protected function getDB( $serverIndex ) {
global $wgDebugDBTransactions;
*/
protected function getDB( $serverIndex ) {
global $wgDebugDBTransactions;
* @param mixed $value
* @param int $exptime
* @return bool
* @param mixed $value
* @param int $exptime
* @return bool
*/
public function cas( $casToken, $key, $value, $exptime = 0 ) {
// Can't find any documentation on xcache cas
*/
public function cas( $casToken, $key, $value, $exptime = 0 ) {
// Can't find any documentation on xcache cas
* @param string $text HTML to check
* @param bool $stderr Whether to read result from STDERR rather than STDOUT
* @param int &$retval Exit code (-1 on internal error)
* @param string $text HTML to check
* @param bool $stderr Whether to read result from STDERR rather than STDOUT
* @param int &$retval Exit code (-1 on internal error)
+ * @return null|string
+ * @throws MWException
*/
private static function clean( $text, $stderr = false, &$retval = null ) {
global $wgTidyInternal;
*/
private static function clean( $text, $stderr = false, &$retval = null ) {
global $wgTidyInternal;
/**
* @param array $values
* @return PPNode_DOM
/**
* @param array $values
* @return PPNode_DOM
*/
public function newPartNodeArray( $values ) {
//NOTE: DOM manipulation is slower than building & parsing XML! (or so Tim sais)
*/
public function newPartNodeArray( $values ) {
//NOTE: DOM manipulation is slower than building & parsing XML! (or so Tim sais)
/**
* Returns a tree of function calls with their real times
* @return string
/**
* Returns a tree of function calls with their real times
* @return string
*/
public function getCallTreeReport() {
if ( $this->collateOnly ) {
*/
public function getCallTreeReport() {
if ( $this->collateOnly ) {
*
* @param string $value
* @return string
*
* @param string $value
* @return string
*/
private static function cssSerializeString( $value ) {
if ( strstr( $value, "\0" ) ) {
*/
private static function cssSerializeString( $value ) {
if ( strstr( $value, "\0" ) ) {
/**
* Get the skip function.
/**
* Get the skip function.
- *
- * @return string|null
+ * @return null|string
+ * @throws MWException
*/
public function getSkipFunction() {
if ( !$this->skipFunction ) {
*/
public function getSkipFunction() {
if ( !$this->skipFunction ) {
/**
* Takes named templates by the module and returns an array mapping.
/**
* Takes named templates by the module and returns an array mapping.
* @return array of templates mapping template alias to content
* @return array of templates mapping template alias to content
*/
public function getTemplates() {
$templates = array();
*/
public function getTemplates() {
$templates = array();
* @param Title $title
* @param array $ids
* @return RevDelList
* @param Title $title
* @param array $ids
* @return RevDelList
*/
public static function createList( $typeName, IContextSource $context, Title $title, array $ids ) {
$typeName = self::getCanonicalTypeName( $typeName );
*/
public static function createList( $typeName, IContextSource $context, Title $title, array $ids ) {
$typeName = self::getCanonicalTypeName( $typeName );
*
* @param string $name The name or path of a skin resource file
* @return string The fully resolved style path url including styleversion
*
* @param string $name The name or path of a skin resource file
* @return string The fully resolved style path url including styleversion
*/
function getSkinStylePath( $name ) {
global $wgStylePath, $wgStyleVersion;
*/
function getSkinStylePath( $name ) {
global $wgStylePath, $wgStyleVersion;
* Main execution point
*
* @param null|string $code Confirmation code passed to the page
* Main execution point
*
* @param null|string $code Confirmation code passed to the page
+ * @throws PermissionsError
+ * @throws ReadOnlyError
+ * @throws UserNotLoggedIn
*/
function execute( $code ) {
$this->setHeaders();
*/
function execute( $code ) {
$this->setHeaders();
/**
* Execute
* @param string|null $par
/**
* Execute
* @param string|null $par
+ * @throws PermissionsError
+ * @throws ReadOnlyError
*/
function execute( $par ) {
$this->setHeaders();
*/
function execute( $par ) {
$this->setHeaders();
* @param int $limit
* @param bool $asc
* @return array
* @param int $limit
* @param bool $asc
* @return array
*/
function reallyDoQuery( $offset, $limit, $asc ) {
$prevTableName = $this->mTableName;
*/
function reallyDoQuery( $offset, $limit, $asc ) {
$prevTableName = $this->mTableName;
*
* @param $skin Skin
* @param $result stdObject Result row
*
* @param $skin Skin
* @param $result stdObject Result row
+ * @return bool|string|void
+ * @throws MWException
*/
public function formatResult( $skin, $result ) {
throw new MWException( "unimplemented" );
*/
public function formatResult( $skin, $result ) {
throw new MWException( "unimplemented" );
* @param float $rand Random number between 0 and 1
* @param int $offset Extra offset to fudge randomness
* @param bool $up True to get the result above the random number, false for below
* @param float $rand Random number between 0 and 1
* @param int $offset Extra offset to fudge randomness
* @param bool $up True to get the result above the random number, false for below
+ * @return array Query information.
+ * @throws MWException
* @note The $up parameter is supposed to counteract what would happen if there
* was a large gap in the distribution of cl_timestamp values. This way instead
* of things to the right of the gap being favoured, both sides of the gap
* are favoured.
* @note The $up parameter is supposed to counteract what would happen if there
* was a large gap in the distribution of cl_timestamp values. This way instead
* of things to the right of the gap being favoured, both sides of the gap
* are favoured.
- * @return array Query information.
*/
protected function getQueryInfo( $rand, $offset, $up ) {
$op = $up ? '>=' : '<=';
*/
protected function getQueryInfo( $rand, $offset, $up ) {
$op = $up ? '>=' : '<=';
* Show a deleted file version requested by the visitor.
* @todo Mostly copied from Special:Undelete. Refactor.
* @param string $archiveName
* Show a deleted file version requested by the visitor.
* @todo Mostly copied from Special:Undelete. Refactor.
* @param string $archiveName
+ * @throws MWException
+ * @throws PermissionsError
*/
protected function tryShowFile( $archiveName ) {
$repo = RepoGroup::singleton()->getLocalRepo();
*/
protected function tryShowFile( $archiveName ) {
$repo = RepoGroup::singleton()->getLocalRepo();
/**
* Special page entry point
* @param string $par
/**
* Special page entry point
* @param string $par
+ * @throws ErrorPageError
+ * @throws Exception
+ * @throws FatalError
+ * @throws MWException
+ * @throws PermissionsError
+ * @throws ReadOnlyError
+ * @throws UserBlockedError
*/
public function execute( $par ) {
$this->setHeaders();
*/
public function execute( $par ) {
$this->setHeaders();
/**
* @param string $msg
* @param string $msgtype
/**
* @param string $msg
* @param string $msgtype
+ * @throws ErrorPageError
+ * @throws Exception
+ * @throws FatalError
+ * @throws MWException
+ * @throws PermissionsError
+ * @throws ReadOnlyError
* @private
*/
function mainLoginForm( $msg, $msgtype = 'error' ) {
* @private
*/
function mainLoginForm( $msg, $msgtype = 'error' ) {
*
* @param string $fqcn FQCN to force the location of
* @param string $inputPath Full path to the file containing the class
*
* @param string $fqcn FQCN to force the location of
* @param string $inputPath Full path to the file containing the class
*/
public function forceClassPath( $fqcn, $inputPath ) {
$path = self::normalizePathSeparator( realpath( $inputPath ) );
*/
public function forceClassPath( $fqcn, $inputPath ) {
$path = self::normalizePathSeparator( realpath( $inputPath ) );
/**
* @param string $inputPath Path to a php file to find classes within
/**
* @param string $inputPath Path to a php file to find classes within
*/
public function readFile( $inputPath ) {
// NOTE: do NOT expand $inputPath using realpath(). It is perfectly
*/
public function readFile( $inputPath ) {
// NOTE: do NOT expand $inputPath using realpath(). It is perfectly
* @param string $algorithm Name of hashing algorithm
* @param BagOStuff $cache
* @param string|array $context Context to mix into HKDF context
* @param string $algorithm Name of hashing algorithm
* @param BagOStuff $cache
* @param string|array $context Context to mix into HKDF context
*/
public function __construct( $secretKeyMaterial, $algorithm, $cache, $context ) {
if ( strlen( $secretKeyMaterial ) < 16 ) {
*/
public function __construct( $secretKeyMaterial, $algorithm, $cache, $context ) {
if ( strlen( $secretKeyMaterial ) < 16 ) {
/**
* Return a singleton instance, based on the global configs.
* @return HKDF
/**
* Return a singleton instance, based on the global configs.
* @return HKDF
*/
protected static function singleton() {
global $wgHKDFAlgorithm, $wgHKDFSecret, $wgSecretKey;
*/
protected static function singleton() {
global $wgHKDFAlgorithm, $wgHKDFSecret, $wgSecretKey;
*
* @param string $hash Hashing Algorithm
* @param string $prk A pseudorandom key of at least HashLen octets
*
* @param string $hash Hashing Algorithm
* @param string $prk A pseudorandom key of at least HashLen octets
- * (usually, the output from the extract step)
+ * (usually, the output from the extract step)
* @param string $info Optional context and application specific information
* @param string $info Optional context and application specific information
- * (can be a zero-length string)
+ * (can be a zero-length string)
* @param int $bytes Length of output keying material in bytes
* @param int $bytes Length of output keying material in bytes
* @param string &$lastK Set by this function to the last block of the expansion.
* @param string &$lastK Set by this function to the last block of the expansion.
- * In MediaWiki, this is used to seed future Extractions.
+ * In MediaWiki, this is used to seed future Extractions.
* @return string Cryptographically secure random string $bytes long
* @return string Cryptographically secure random string $bytes long
*/
private static function HKDFExpand( $hash, $prk, $info, $bytes, &$lastK = '' ) {
$hashLen = MWCryptHKDF::$hashLength[$hash];
*/
private static function HKDFExpand( $hash, $prk, $info, $bytes, &$lastK = '' ) {
$hashLen = MWCryptHKDF::$hashLength[$hash];
/**
* @param array $info (UIDGenerator::millitime(), counter, clock sequence)
* @return string 88 bits
/**
* @param array $info (UIDGenerator::millitime(), counter, clock sequence)
* @return string 88 bits
*/
protected function getTimestampedID88( array $info ) {
list( $time, $counter ) = $info;
*/
protected function getTimestampedID88( array $info ) {
list( $time, $counter ) = $info;
/**
* @param array $info (UIDGenerator::millitime(), counter, clock sequence)
* @return string 128 bits
/**
* @param array $info (UIDGenerator::millitime(), counter, clock sequence)
* @return string 128 bits
*/
protected function getTimestampedID128( array $info ) {
list( $time, $counter, $clkSeq ) = $info;
*/
protected function getTimestampedID128( array $info ) {
list( $time, $counter, $clkSeq ) = $info;
* @param int $count Number of IDs to return (1 to 10000)
* @param int $flags (supports UIDGenerator::QUICK_VOLATILE)
* @return array Ordered list of float integer values
* @param int $count Number of IDs to return (1 to 10000)
* @param int $flags (supports UIDGenerator::QUICK_VOLATILE)
* @return array Ordered list of float integer values
*/
protected function getSequentialPerNodeIDs( $bucket, $bits, $count, $flags ) {
if ( $count <= 0 ) {
*/
protected function getSequentialPerNodeIDs( $bucket, $bits, $count, $flags ) {
if ( $count <= 0 ) {
/**
* @param array $time Result of UIDGenerator::millitime()
* @return string 46 MSBs of "milliseconds since epoch" in binary (rolls over in 4201)
/**
* @param array $time Result of UIDGenerator::millitime()
* @return string 46 MSBs of "milliseconds since epoch" in binary (rolls over in 4201)
*/
protected function millisecondsSinceEpochBinary( array $time ) {
list( $sec, $msec ) = $time;
*/
protected function millisecondsSinceEpochBinary( array $time ) {
list( $sec, $msec ) = $time;
* Throw an error, and log a debug message
* @param mixed $code
* @param string $debugMessage
* Throw an error, and log a debug message
* @param mixed $code
* @param string $debugMessage
+ * @throws ZipDirectoryReaderError
*/
function error( $code, $debugMessage ) {
wfDebug( __CLASS__ . ": Fatal error: $debugMessage\n" );
*/
function error( $code, $debugMessage ) {
wfDebug( __CLASS__ . ": Fatal error: $debugMessage\n" );
* Insert a temporary test article
* @param string $name The title, including any prefix
* @param string $text The article text
* Insert a temporary test article
* @param string $name The title, including any prefix
* @param string $text The article text
- * @param int $line The input line number, for reporting errors
- * @param bool $ignoreDuplicate Whether to silently ignore duplicate pages
+ * @param int|string $line The input line number, for reporting errors
+ * @param bool|string $ignoreDuplicate Whether to silently ignore duplicate pages
+ * @throws Exception
+ * @throws MWException
*/
public static function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) {
global $wgCapitalLinks;
*/
public static function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) {
global $wgCapitalLinks;
/**
* Return general data to be encoded for testing
* @return array See self::testGeneralEncoding
/**
* Return general data to be encoded for testing
* @return array See self::testGeneralEncoding
*/
public static function provideGeneralEncoding() {
throw new Exception( 'Subclass must implement ' . __METHOD__ );
*/
public static function provideGeneralEncoding() {
throw new Exception( 'Subclass must implement ' . __METHOD__ );
* @param array $params Query parameters
* @param array $data Data to encode
* @param string $class Printer class to use instead of the normal one
* @param array $params Query parameters
* @param array $data Data to encode
* @param string $class Printer class to use instead of the normal one
+ * @return string
+ * @throws Exception
*/
protected function encodeData( array $params, array $data, $class = null ) {
$context = new RequestContext;
*/
protected function encodeData( array $params, array $data, $class = null ) {
$context = new RequestContext;
* An array of tests in the form of (bool, string, string), where the first
* element is whether the second parameter (a password hash) and the third
* parameter (a password) should match.
* An array of tests in the form of (bool, string, string), where the first
* element is whether the second parameter (a password hash) and the third
* parameter (a password) should match.
* @abstract
*/
public static function providePasswordTests() {
* @abstract
*/
public static function providePasswordTests() {
* @param bool $fatal True iff an exception should be thrown if
* the section is not found.
* @return bool|string
* @param bool $fatal True iff an exception should be thrown if
* the section is not found.
* @return bool|string
*/
private function checkSection( $tokens, $fatal = true ) {
if ( is_null( $this->section ) ) {
*/
private function checkSection( $tokens, $fatal = true ) {
if ( is_null( $this->section ) ) {
* Should be the case if we found the parserTest is not disabled
* @param ParserTest|NewParserTest $parserTest
* @return bool
* Should be the case if we found the parserTest is not disabled
* @param ParserTest|NewParserTest $parserTest
* @return bool
*/
public function unleash( &$parserTest ) {
if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest ) ) {
*/
public function unleash( &$parserTest ) {
if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest ) ) {