$target: Title/string of redirect target
$article: Article object
+'InterwikiLoadPrefix': When resolving if a given prefix is an interwiki or not.
+Return true without providing an interwiki to continue interwiki search.
+$prefix: interwiki prefix we are looking for.
+&$iwData: output array describing the interwiki with keys iw_url, iw_local,
+ iw_trans and optionally iw_api and iw_wikiid.
+
'InternalParseBeforeLinks': during Parser's internalParse method before links
but after noinclude/includeonly/onlyinclude and other processing.
&$parser: Parser object
*/
protected static function load( $prefix ) {
global $wgMemc, $wgInterwikiExpiry;
- $key = wfMemcKey( 'interwiki', $prefix );
- $mc = $wgMemc->get( $key );
- if( $mc && is_array( $mc ) ) { // is_array is hack for old keys
- $iw = Interwiki::loadFromArray( $mc );
+ $iwData = false;
+ if ( !wfRunHooks('InterwikiLoadPrefix', array( $prefix, &$iwData ) ) ) {
+ return Interwiki::loadFromArray( $iwData );
+ }
+
+ if ( !$iwData ) {
+ $key = wfMemcKey( 'interwiki', $prefix );
+ $iwData = $wgMemc->get( $key );
+ }
+
+ if( $iwData && is_array( $iwData ) ) { // is_array is hack for old keys
+ $iw = Interwiki::loadFromArray( $iwData );
if( $iw ) {
return $iw;
}