Go to the documentation of this file.
37 $this->mCanonicalServer = $canonicalServer;
39 $this->mServer = $server ?? $canonicalServer;
49 $parsed =
wfParseUrl( $this->mCanonicalServer );
51 return $parsed[
'host'];
71 $page =
wfUrlencode( str_replace(
' ',
'_', $page ) );
73 if ( is_string( $fragmentId ) && $fragmentId !==
'' ) {
77 return str_replace(
'$1', $page, $this->mPath );
89 return $this->mCanonicalServer . $this->
getLocalUrl( $page, $fragmentId );
107 public function getUrl( $page, $fragmentId =
null ) {
121 return $this->mServer .
__construct( $canonicalServer, $path, $server=null)
getUrl( $page, $fragmentId=null)
Alias for getCanonicalUrl(), for backwards compatibility.
getFullUrl( $page, $fragmentId=null)
Get a URL based on $wgServer, like Title::getFullURL() would produce when called locally on the wiki.
$mCanonicalServer
canonical server URL, e.g. 'https://www.mediawiki.org'
wfUrlencode( $s)
We want some things to be included as literal characters in our title URLs for prettiness,...
getLocalUrl( $page, $fragmentId=null)
Helper function for getUrl()
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
getDisplayName()
Get the URL in a way to be displayed to the user More or less Wikimedia specific.
$mServer
server URL, may be protocol-relative, e.g. '//www.mediawiki.org'
getCanonicalUrl( $page, $fragmentId=null)
Get a canonical (i.e.
Reference to a locally-hosted wiki.
getCanonicalServer()
Get a canonical server URL.