MediaWiki  REL1_22
WikiReference Class Reference

Reference to a locally-hosted wiki. More...

List of all members.

Public Member Functions

 __construct ($major, $minor, $canonicalServer, $path, $server=null)
 getCanonicalServer ()
 Get a canonical server URL.
 getCanonicalUrl ($page)
 Get a canonical (i.e.
 getDisplayName ()
 Get the the URL in a way to de displayed to the user More or less Wikimedia specific.
 getFullUrl ($page)
 Get a URL based on $wgServer, like Title::getFullURL() would produce when called locally on the wiki.
 getHostname ()
 getUrl ($page)
 Alias for getCanonicalUrl(), for backwards compatibility.

Private Member Functions

 getLocalUrl ($page)
 Helper function for getUrl()

Private Attributes

 $mCanonicalServer
 canonical server URL, e.g. 'http://www.mediawiki.org'
 $mMajor
 'wiki', 'wiktionary', etc
 $mMinor
 'en', 'meta', 'mediawiki', etc
 $mPath
 path, '/wiki/$1'
 $mServer
 server URL, may be protocol-relative, e.g. '//www.mediawiki.org'

Detailed Description

Reference to a locally-hosted wiki.

Definition at line 127 of file WikiMap.php.


Constructor & Destructor Documentation

WikiReference::__construct ( major,
minor,
canonicalServer,
path,
server = null 
)
Parameters:
$majorstring
$minorstring
$canonicalServerstring
$pathstring
$servernull|string

Definition at line 141 of file WikiMap.php.

References $path.


Member Function Documentation

Get a canonical server URL.

Returns:
string

Definition at line 205 of file WikiMap.php.

Get a canonical (i.e.

based on $wgCanonicalServer) URL to a page on this foreign wiki

Parameters:
string$pagepage name (must be normalised before calling this function!)
Returns:
String: Url

Definition at line 197 of file WikiMap.php.

References getLocalUrl().

Referenced by getUrl().

Get the the URL in a way to de displayed to the user More or less Wikimedia specific.

Returns:
String

Definition at line 169 of file WikiMap.php.

References getUrl(), and wfParseUrl().

Get a URL based on $wgServer, like Title::getFullURL() would produce when called locally on the wiki.

Parameters:
string$pagepage name (must be normalized before calling this function!)
Returns:
String: URL

Definition at line 225 of file WikiMap.php.

References getLocalUrl().

Returns:
string
Exceptions:
MWException

Definition at line 153 of file WikiMap.php.

References array(), and as.

WikiReference::getLocalUrl ( page) [private]

Helper function for getUrl()

Todo:
FIXME: This may be generalized...
Parameters:
string$pagepage name (must be normalised before calling this function!)
Returns:
String: Url fragment

Definition at line 187 of file WikiMap.php.

Referenced by getCanonicalUrl(), and getFullUrl().

WikiReference::getUrl ( page)

Alias for getCanonicalUrl(), for backwards compatibility.

Parameters:
$pagestring
Returns:
String

Definition at line 214 of file WikiMap.php.

References getCanonicalUrl().

Referenced by getDisplayName().


Member Data Documentation

WikiReference::$mCanonicalServer [private]

canonical server URL, e.g. 'http://www.mediawiki.org'

Definition at line 130 of file WikiMap.php.

WikiReference::$mMajor [private]

'wiki', 'wiktionary', etc

Definition at line 129 of file WikiMap.php.

WikiReference::$mMinor [private]

'en', 'meta', 'mediawiki', etc

Definition at line 128 of file WikiMap.php.

WikiReference::$mPath [private]

path, '/wiki/$1'

Definition at line 132 of file WikiMap.php.

WikiReference::$mServer [private]

server URL, may be protocol-relative, e.g. '//www.mediawiki.org'

Definition at line 131 of file WikiMap.php.


The documentation for this class was generated from the following file: