* extract( $globals );
* @endcode
*
+ * @note For WikiMap to function, the configuration must define string values for
+ * $wgServer (or $wgCanonicalServer) and $wgArticlePath, even if these are the
+ * same for all wikis or can be correctly determined by the logic in
+ * Setup.php.
+ *
* @todo Give examples for,
* suffixes:
* $conf->suffixes = array( 'wiki' );
$path = $wgConf->get( 'wgArticlePath', $wikiID, $major,
[ 'lang' => $minor, 'site' => $major ] );
+
+ // If we don't have a canonical server or a path containing $1, the
+ // WikiReference isn't going to function properly. Just return null in
+ // that case.
+ if ( !is_string( $canonicalServer ) || !is_string( $path ) || strpos( $path, '$1' ) === false ) {
+ return null;
+ }
+
return new WikiReference( $canonicalServer, $path, $server );
}
'wgServer' => [
'enwiki' => 'http://en.example.org',
'ruwiki' => '//ru.example.org',
+ 'nopathwiki' => '//nopath.example.org',
],
'wgArticlePath' => [
'enwiki' => '/w/$1',
'nlwiki (sites)' => [ $nlwiki, 'nlwiki', false ],
'enwiktionary (sites)' => [ $enwiktionary, 'enwiktionary', false ],
'non MediaWiki site' => [ null, 'spam', false ],
+ 'boguswiki' => [ null, 'boguswiki' ],
+ 'nopathwiki' => [ null, 'nopathwiki' ],
];
}