* Added pp_sortkey column to page_props table, so pages can be efficiently
queried and sorted by property value (bug 58032).
See $wgPagePropsHaveSortkey if you want to postpone the schema change.
-* BREAKING CHANGE: The Modern and Cologne Blue skins were moved out of MediaWiki
- core to their own respective repositories. See also
- https://www.mediawiki.org/wiki/Skin:Modern and
- https://www.mediawiki.org/wiki/Skin:CologneBlue.
+* BREAKING CHANGE: All four built-in MediaWiki skins (Vector, MonoBook, Modern
+ and Cologne Blue) were moved out of MediaWiki core to their own respective
+ repositories. They will be installed with the release tarball, but you must
+ install them separately if installing MediaWiki from source code. A warning
+ message displayed until you do it should guide you through the process. See
+ also <https://www.mediawiki.org/wiki/Manual:Skin_configuration>.
* BREAKING CHANGE: Skins built for MediaWiki 1.15 and earlier that do not use
the "headelement" template key are no longer supported. Setting
$useHeadElement = false; is no longer supported and will not cause old keys
-Extensions (such as the hieroglyphic module WikiHiero) are distributed
-separately. Drop them into this extensions directory and enable as
-per the extension's directions.
+Extensions are distributed separately. Drop them into this directory and enable
+as per the extension's installation instructions.
-You can find a list of extensions and documentation on the MediaWiki website:
- https://www.mediawiki.org/wiki/Category:Extensions
+You can find a list of extensions and documentation at
+<https://www.mediawiki.org/wiki/Category:Extensions>.
-If you are a developer, you want to fetch the extension tree in another
+If you are a developer, you might want to fetch the extension tree in another
directory and make a symbolic link:
- mediawiki/extensions$ ln -s ../../extensions-trunk/FooBarExt
+ mediawiki/extensions$ ln -s ../../extensions-trunk/FooBar
Most extensions are available through Git:
- https://gerrit.wikimedia.org/r/#/admin/projects/
+ https://gerrit.wikimedia.org/r/#/admin/projects/?filter=mediawiki%252Fextensions%252F
https://git.wikimedia.org/project/mediawiki
-Old extensions are on Subversion:
- https://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/
-
Please note that under POSIX systems (Linux...), parent of a symbolic path
refers to the link source, NOT to the target! You should check the env
* - If there are multiple exact or range blocks at the same level, the one chosen
* is random
*
+ * @param array $blocks Array of blocks
* @param array $ipChain List of IPs (strings). This is used to determine how "close"
* a block is to the server, and if a block matches exactly, or is in a range.
* The order is furthest from the server to nearest e.g., (Browser, proxy1, proxy2,
* local-squid, ...)
- * @param array $block Array of blocks
* @return Block|null The "best" block from the list
*/
public static function chooseBlock( array $blocks, array $ipChain ) {
// create instance from factory
$instance = call_user_func( $factory, $this->mParent, $name );
- if ( ! $instance instanceof $class ) {
+ if ( !$instance instanceof $class ) {
throw new MWException( "The factory function for module $name did not return an instance of $class!" );
}
} else {
private $mSpecialTitles = array();
private $mNormalizedTitles = array();
private $mInterwikiTitles = array();
+ /** @var Title[] */
private $mPendingRedirectIDs = array();
private $mConvertedTitles = array();
private $mGoodRevIDs = array();
private $mFakePageId = -1;
private $mCacheMode = 'public';
private $mRequestedPageFields = array();
- /**
- * @var int
- */
+ /** @var int */
private $mDefaultNamespace = NS_MAIN;
/**
/**
* Get a list of redirect resolutions - maps a title to its redirect
* target, as an array of output-ready arrays
- * @return array
+ * @return Title[]
*/
public function getRedirectTitles() {
return $this->mRedirectTitles;
/**
* Get the list of titles with negative namespace
- * @return array Title
+ * @return Title[]
*/
public function getSpecialTitles() {
return $this->mSpecialTitles;
$hasInterwikiResults = false;
if ( $interwiki && $resultPageSet === null && $matches->hasInterwikiResults() ) {
$matches = $matches->getInterwikiResults();
- $iwprefixes = array();
$hasInterwikiResults = true;
// Include number of results if requested
*
* @since 1.24
* @param string|null $continue The "continue" parameter, if any
- * @param array $allModules Contains ApiBase instances that will be executed
+ * @param ApiBase[] $allModules Contains ApiBase instances that will be executed
* @param array $generatedModules Names of modules that depend on the generator
* @return array Two elements: a boolean indicating if the generator is done,
* and an array of modules to actually execute.
* @ingroup API
*/
class ApiUpload extends ApiBase {
- /** @var UploadBase */
+ /** @var UploadBase|UploadFromChunks */
protected $mUpload = null;
protected $mParams;
}
} else {
$filekey = $this->mParams['filekey'];
- /** @var $status Status */
$status = $this->mUpload->addChunk(
$chunkPath, $chunkSize, $this->mParams['offset'] );
if ( !$status->isGood() ) {
if ( isset( $warnings['duplicate'] ) ) {
$dupes = array();
+ /** @var File $dupe */
foreach ( $warnings['duplicate'] as $dupe ) {
$dupes[] = $dupe->getName();
}
if ( isset( $warnings['exists'] ) ) {
$warning = $warnings['exists'];
unset( $warnings['exists'] );
+ /** @var LocalFile $localFile */
$localFile = isset( $warning['normalizedFile'] )
? $warning['normalizedFile']
: $warning['file'];
/**
* Parsing RC_* constants to human-readable test
* @since 1.24
- * @param int $rc_type
+ * @param int $rcType
* @return string $type
*/
public static function parseFromRCType( $rcType ) {
return wfTimestamp( TS_POSTGRES, $ts );
}
- /*
+ /**
* Posted by cc[plus]php[at]c2se[dot]com on 25-Mar-2009 09:12
* to http://www.php.net/manual/en/ref.pgsql.php
*
* Fields can be retrieved with $row->fieldname, with fields acting like
* member variables.
*
- * @return object
+ * @return stdClass
* @throws DBUnexpectedError Thrown if the database returns an error
*/
function fetchObject() {
$this->db->dataSeek( $this, $row );
}
- /*********************
- * Iterator functions
+ /*
+ * ======= Iterator functions =======
* Note that using these in combination with the non-iterator functions
* above may cause rows to be skipped or repeated.
*/
}
/**
- * @return int
+ * @return stdClass|array|false
*/
function current() {
if ( is_null( $this->currentRow ) ) {
}
/**
- * @return int
+ * @return stdClass
*/
function next() {
$this->pos++;
return count( $this->result );
}
+ /**
+ * @return array|bool
+ */
function fetchRow() {
if ( $this->pos < count( $this->result ) ) {
$this->currentRow = $this->result[$this->pos];
function free() {
}
- // Callers want to be able to access fields with $this->fieldName
+ /**
+ * Callers want to be able to access fields with $this->fieldName
+ * @return false|stdClass
+ */
function fetchObject() {
$this->fetchRow();
if ( $this->currentRow ) {
$this->currentRow = null;
}
+ /**
+ * @return false|stdClass
+ */
function next() {
return $this->fetchObject();
}
* Sanitize and filter the custom headers from a $params array.
* We only allow certain Content- and X-Content- headers.
*
- * @param array $headers
+ * @param array $params
* @return array Sanitized value of 'headers' field in $params
*/
protected function sanitizeHdrs( array $params ) {
*
* STUB
* @param string $hash SHA-1 hash
- * @return array
+ * @return File[]
*/
public function findBySha1( $hash ) {
return array();
} elseif ( is_array( $triple[2] ) && isset( $triple[2]['headers'] ) ) {
$headers = $triple[2]['headers'];
}
+ // @fixme: $headers might not be defined
$operations[] = array(
'op' => FileBackend::isStoragePath( $src ) ? 'copy' : 'store',
'src' => $src,
/**
* @throws MWException
- * @param array $row
+ * @param stdClass $row
* @return LocalFile
*/
function newFileFromRow( $row ) {
$hashPath = $this->getDeletedHashPath( $key );
$path = "$root/$hashPath$key";
$dbw->begin( __METHOD__ );
- // Check for usage in deleted/hidden files and pre-emptively
+ // Check for usage in deleted/hidden files and preemptively
// lock the key to avoid any future use until we are finished.
$deleted = $this->deletedFileHasKey( $key, 'lock' );
$hidden = $this->hiddenFileHasKey( $key, 'lock' );
* Checks if there is a redirect named as $title
*
* @param Title $title Title of file
- * @return bool
+ * @return bool|Title
*/
function checkRedirect( Title $title ) {
global $wgMemc;
* SHA-1 content hash.
*
* @param string $hash A sha1 hash to look for
- * @return array
+ * @return File[]
*/
function findBySha1( $hash ) {
$dbr = $this->getSlaveDB();
/**
* Interface for FileRepo::checkRedirect()
* @param Title $title
- * @return bool
+ * @return bool|Title
*/
function checkRedirect( Title $title ) {
if ( !$this->reposInitialised ) {
* Find all instances of files with this key
*
* @param string $hash Base 36 SHA-1 hash
- * @return array Array of File objects
+ * @return File[]
*/
function findBySha1( $hash ) {
if ( !$this->reposInitialised ) {
* @note Use getWidth()/getHeight() instead of this method unless you have a
* a good reason. This method skips all caches.
*
- * @param string $fileName The path to the file (e.g. From getLocalPathRef() )
+ * @param string $filePath The path to the file (e.g. From getLocalPathRef() )
* @return array The width, followed by height, with optionally more things after
*/
function getImageSize( $filePath ) {
* @param string $tableName The table name
* @param string $oldIndexName The old index name
* @param string $newIndexName The new index name
+ * @param string $sqlPath The path to the SQL change path
* @param bool $skipBothIndexExistWarning Whether to warn if both the old
* and the new indexes exist. [facultative; by default, false]
- * @param string $sqlPath The path to the SQL change path
*/
public function renameExtensionIndex( $tableName, $oldIndexName, $newIndexName,
$sqlPath, $skipBothIndexExistWarning = false
/**
* Try to see if a given fulltext catalog exists
* We assume we already have the appropriate database selected
- * @param string $schemaName Catalog name to check
+ * @param string $catalogName Catalog name to check
* @return bool
*/
private function catalogExists( $catalogName ) {
/** Add misc metadata. Warning: atm if the metadata category
* doesn't have a priority, it will be silently discarded.
*
- * @param array $meta Array of metadata values
+ * @param array $metaArray Array of metadata values
* @param string $type Type. defaults to other. if two things have the same type they're merged
*/
function addMetadata( $metaArray, $type = 'other' ) {
return 2; // We don't need no bloddy constants!
}
- /**#@+
+ /**
* Validates if a tag value is of the type it should be according to the Exif spec
*
* @param mixed $in The input value to check
// Do nothing
}
- /*
+ /**
* True if the handler can rotate the media
* @since 1.21
* @return bool
*
* @param File $file The image object, or false if there isn't one.
* Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!)
- * @param string $path The filename
+ * @param string $filename The filename
* @return string
*/
public function getMetadata( $file, $filename ) {
}
/**
- * @param string $key
* @param mixed $casToken
+ * @param string $key
* @param mixed $value
* @param int $exptime
* @return bool
* Store a value in the WinCache object cache
*
* @param string $key Cache key
- * @param mixed $valueObject Value to store
+ * @param mixed $value Value to store
* @param int $expire Expiration time
* @return bool
*/
* @param Content $content Content submitted
* @param User $user The relevant user
* @param string $comment Comment submitted
- * @param string $serialisation_format Format for storing the content in the database
* @param bool $minor Whereas it's a minor modification
+ * @param string $serialisation_format Format for storing the content in the database
*/
public function doQuickEditContent( Content $content, User $user, $comment = '', $minor = false,
$serialisation_format = null
/**
* @param Page $page
+ * @param ParserOptions $parserOptions ParserOptions to use for the parse
* @param int $revid ID of the revision being parsed.
* @param bool $useParserCache Whether to use the parser cache.
- * @param ParserOptions $parserOptions ParserOptions to use for the parse
* operation.
* @param Content|string $content Content to parse or null to load it; may
* also be given as a wikitext string, for BC.
* Suggest a target for the revision deletion
* @since 1.22
* @param string $typeName
- * @param Title|null $title User-supplied target
+ * @param Title|null $target User-supplied target
* @param array $ids
* @return Title|null
*/
return "$numeric $type $name";
}
- /*
+ /**
* Return values for <html> element
* @return array of associative name-to-value elements for <html> element
*/
*/
protected $hideRights = array();
+ /**
+ * @var array
+ */
+ private $blockStatusByUid;
+
/**
* @param IContextSource $context
* @param null $group Unused
}
}
- /*
+ /**
* @param string|null $subPage
*/
public function execute( $subPage ) {
return null;
}
+ /** @var UploadBase $handler */
$handler = new $className;
$handler->initializeFromRequest( $request );
/**
* Return the local file and initializes if necessary.
*
- * @return LocalFile|null
+ * @return LocalFile|UploadStashFile|null
*/
public function getLocalFile() {
if ( is_null( $this->mLocalFile ) ) {
/**
* Divide the element name passed by the xml parser to the callback into URI and prifix.
- * @param string $name
+ * @param string $element
* @return array Containing the namespace URI and prefix
*/
private static function splitXmlNamespace( $element ) {
* Get the current status of a chunked upload (used for polling).
* The status will be read from the *current* user session.
* @param string $statusKey
- * @return array|bool
+ * @return Status[]|bool
*/
public static function getSessionStatus( $statusKey ) {
return isset( $_SESSION[self::SESSION_STATUS_KEY][$statusKey] )
protected $mChunkIndex;
protected $mFileKey;
protected $mVirtualTempPath;
+ /** @var LocalRepo */
+ private $repo;
/**
* Setup local pointers to stash, repo and user (similar to UploadFromStash)
* and the SKM (source key material) is the "data".
*
* @param string $hash The hashing function to use (e.g., sha256)
- * @param string $ikm The input keying material
* @param string $salt The salt to add to the ikm, to get the prk
+ * @param string $ikm The input keying material
* @return string Binary string (pseudorandm key) used as input to HKDFExpand
*/
private static function HKDFExtract( $hash, $salt, $ikm ) {
}
/**
- * @param array $time (UIDGenerator::millitime(), clock sequence)
+ * @param array $info (UIDGenerator::millitime(), clock sequence)
* @return string 88 bits
*/
protected function getTimestampedID88( array $info ) {
/**
* Returns true if a language code is an IETF tag known to MediaWiki.
*
- * @param string $code
+ * @param string $tag
*
* @since 1.21
* @return bool
* Checks that convertPlural was given an array and pads it to requested
* amount of forms by copying the last one.
*
- * @param int $count How many forms should there be at least
* @param array $forms Array of forms given to convertPlural
+ * @param int $count How many forms should there be at least
* @return array Padded array of forms or an exception if not an array
*/
protected function preConvertPlural( /* Array */ $forms, $count ) {
/**
* @todo Do this for real
- * @param int $ns
- * @param string $name
+ * @param int $key
+ * @param string $prefix
* @param bool $fix
* @param string $suffix
* @return bool
--- /dev/null
+Skins, such as the default skin Vector, are distributed separately. Drop them
+into this directory and enable as per the skin's installation instructions.
+
+You can find a list of available skins at
+<https://www.mediawiki.org/wiki/Category:All_skins>,
+and more information about installing and configuring skins at
+<https://www.mediawiki.org/wiki/Manual:Skin_configuration>.
+
+If you are a developer, you might want to fetch the skin tree in another
+directory and make a symbolic link:
+
+ mediawiki/skins$ ln -s ../../skins-trunk/FooBar
+
+Most skins are available through Git:
+ https://gerrit.wikimedia.org/r/#/admin/projects/?filter=mediawiki%252Fskins%252F
+ https://git.wikimedia.org/project/mediawiki
+
+
+Please note that under POSIX systems (Linux...), parent of a symbolic path
+refers to the link source, NOT to the target! You should check the env
+variable MW_INSTALL_PATH in case the extension is not in the default location.
+
+The following code snippet lets you override the default path:
+
+ $IP = getenv( 'MW_INSTALL_PATH' );
+ if( $IP === false ) {
+ $IP = __DIR__ . '/../..';
+ }
+ require_once "$IP/maintenance/Maintenance.php"; // a MediaWiki core file
/**
* @dataProvider providerGetDisplayWidthHeight
- * @param array $dimensions Array [maxWidth, maxHeight, width, height]
+ * @param array $dim Array [maxWidth, maxHeight, width, height]
* @param array $expected Array [width, height] The width and height we expect to display at
*/
function testGetDisplayWidthHeight( $dim, $expected ) {
'logout',
'action',
'ApiLogout',
- function( ApiMain $main, $action ) {
- return new ApiLogout( $main, $action );
+ function ( ApiMain $main, $action ) {
+ return new ApiLogout( $main, $action );
},
),
);
),
'logout' => array(
'class' => 'ApiLogout',
- 'factory' => function( ApiMain $main, $action ) {
+ 'factory' => function ( ApiMain $main, $action ) {
return new ApiLogout( $main, $action );
},
),
),
'logout' => array(
'class' => 'ApiLogout',
- 'factory' => function( ApiMain $main, $action ) {
- return new ApiLogout( $main, $action );
- },
+ 'factory' => function ( ApiMain $main, $action ) {
+ return new ApiLogout( $main, $action );
+ },
),
);
* @param array $params Api parameters
* @param int $expectedCount Max number of iterations
* @param string $id Unit test id
- * @param bool $useContinue True to use smart continue
+ * @param bool $continue True to use smart continue
* @return Merged results data array
*/
protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) {
* @param string $titlePart
* @param int $namespace
* @param string $expected
- * @param string $description
+ * @param string $expectException
* @dataProvider provideTestTitlePartToKey
*/
function testTitlePartToKey( $titlePart, $namespace, $expected, $expectException ) {
* @dataProvider provideDataToEncode
*/
public function testBeautifyUsesFormatJson( $data ) {
- $obj = new JSONContent( FormatJson::encode( $data) );
+ $obj = new JSONContent( FormatJson::encode( $data ) );
$this->assertEquals( FormatJson::encode( $data, true ), $obj->beautifyJSON() );
}
*/
public function testPreSaveTransform( $data ) {
$obj = new JSONContent( FormatJson::encode( $data ) );
- $newObj = $obj->preSaveTransform( $this->getMockTitle(), $this->getMockUser() , $this->getMockParserOptions() );
+ $newObj = $obj->preSaveTransform( $this->getMockTitle(), $this->getMockUser(), $this->getMockParserOptions() );
$this->assertTrue( $newObj->equals( new JSONContent( FormatJson::encode( $data, true ) ) ) );
}
),
);
}
-
-}
\ No newline at end of file
+}
/**
* @param string $filename
* @param int $expectedWidth Width
- * @param int $expectedHeigh Height
+ * @param int $expectedHeight Height
* @dataProvider provideGetImageSize
* @covers XCFHandler::getImageSize
*/
*/
public function testRegister() {
$factory = new SkinFactory();
- $factory->register( 'fallback', 'Fallback', function() {
+ $factory->register( 'fallback', 'Fallback', function () {
return new SkinFallback();
} );
$this->assertTrue( true ); // No exception thrown
*
* @param Page $page Page to add the revision to
* @param string $text Revisions text
- * @param string $text Revisions summare
+ * @param string $summary Revisions summare
*
* @throws MWException
*/
* Asserts that the xml reader is at the final closing tag of an xml file and
* closes the reader.
*
- * @param string $tag (optional) the name of the final tag
+ * @param string $name (optional) the name of the final tag
* (e.g.: "mediawiki" for </mediawiki>)
*/
protected function assertDumpEnd( $name = "mediawiki" ) {
* @param string $text_sha1 The base36 SHA-1 of the revision's text
* @param string|bool $text (optional) The revision's string, or false to check for a
* revision stub
+ * @param int|bool $parentid (optional) id of the parent revision
* @param string $model The expected content model id (default: CONTENT_MODEL_WIKITEXT)
* @param string $format The expected format model id (default: CONTENT_FORMAT_WIKITEXT)
- * @param int|bool $parentid (optional) id of the parent revision
*/
protected function assertRevision( $id, $summary, $text_id, $text_bytes,
$text_sha1, $text = false, $parentid = false,
*
* @param WikiPage $page The page to add the revision to
* @param string $text The revisions text
- * @param string $text The revisions summare
+ * @param string $summary The revisions summare
*
* @throws MWException
*/
* Throw an exception if it is not set, referencing current section
* and adding the current file name and line number
*
- * @param string|array $token Expected token(s) that should have been
+ * @param string|array $tokens Expected token(s) that should have been
* mentioned before closing this section
* @param bool $fatal True iff an exception should be thrown if
* the section is not found.
/**
* Similar to ParserTest object but does not run anything
* Use unleash() to really execute the hook function
- * @param string $fnHook
+ * @param string $hook
*/
public function requireTransparentHook( $hook ) {
$this->transparentHooks[] = $hook;
* file handler.
*
* @param File $file File object for file in question
- * @param array $param Array of parameters so far
+ * @param array $params Array of parameters so far
* @return array Parameters array with more parameters
*/
function wfExtractThumbParams( $file, $params ) {