upgrade PHP if you have not done so prior to upgrading MediaWiki.
=== Configuration changes in 1.20 ===
+* $wgGitRepositoryViewers defines a mapping from Git remote repository to the
+ Gitweb instance URL used in Special:Version
* `$wgUsePathInfo = true;` is no longer needed to make $wgArticlePath work on servers
using like nginx, lighttpd, and apache over fastcgi. MediaWiki now always extracts
path info from REQUEST_URI if it's available.
*/
$wgUpgradeKey = false;
+/**
+ * Map GIT repository URLs to viewer URLs to provide links in Special:Version
+ *
+ * Key is a pattern passed to preg_match() and preg_replace(),
+ * without the delimiters (which are #) and must match the whole URL.
+ * The value is the replacement for the key (it can contain $1, etc.)
+ * %h will be replaced by the short SHA-1 (7 first chars) and %H by the
+ * full SHA-1 of the HEAD revision.
+ */
+$wgGitRepositoryViewers = array(
+ 'https://gerrit.wikimedia.org/r/p/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%H',
+ 'ssh://(?:[a-z0-9_]+@)?gerrit.wikimedia.org:29418/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%H',
+);
+
/** @} */ # End of maintenance }
/************************************************************************//**
* @return array
*/
protected static function getViewers() {
- if( self::$viewers === false ) {
-
- // Map of repo URLs to viewer URLs.
- //
- // Key is a pattern passed to preg_match() and preg_replace(),
- // without the delimiters (which are #) and must match the whole URL.
- // The value is the replacement for the key (it can contain $1, etc.)
- // %h will be replaced by the short SHA-1 (7 first chars) and %H by the
- // full SHA-1 of the HEAD revision.
- self::$viewers = array(
- 'https://gerrit.wikimedia.org/r/p/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%H',
- 'ssh://(?:[a-z0-9_]+@)?gerrit.wikimedia.org:29418/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%H',
- );
+ global $wgGitRepositoryViewers;
+ if( self::$viewers === false ) {
+ self::$viewers = $wgGitRepositoryViewers;
wfRunHooks( 'GitViewers', array( &self::$viewers ) );
}