BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
MediaWikiSite Class Reference
Inheritance diagram for MediaWikiSite:
Collaboration diagram for MediaWikiSite:

Public Member Functions

 __construct ($type=self::TYPE_MEDIAWIKI)
 
 toDBKey ($title)
 
 normalizePageName ($pageName)
 
 getLinkPathType ()
 
 getRelativePagePath ()
 
 getRelativeFilePath ()
 
 setPagePath ($path)
 
 setFilePath ($path)
 
 getPageUrl ($pageName=false)
 
 getFileUrl ($path=false)
 
- Public Member Functions inherited from Site
 __construct ($type=self::TYPE_UNKNOWN)
 
 getGlobalId ()
 
 setGlobalId ($globalId)
 
 getType ()
 
 getGroup ()
 
 setGroup ($group)
 
 getSource ()
 
 setSource ($source)
 
 shouldForward ()
 
 setForward ($shouldForward)
 
 getDomain ()
 
 getProtocol ()
 
 setLinkPath ($fullUrl)
 
 getLinkPath ()
 
 getLinkPathType ()
 
 getPageUrl ($pageName=false)
 
 normalizePageName ($pageName)
 
 getExtraData ()
 
 setExtraData (array $extraData)
 
 getExtraConfig ()
 
 setExtraConfig (array $extraConfig)
 
 getLanguageCode ()
 
 setLanguageCode ($languageCode)
 
 getInternalId ()
 
 setInternalId ($internalId=null)
 
 addLocalId ($type, $identifier)
 
 addInterwikiId ($identifier)
 
 addNavigationId ($identifier)
 
 getInterwikiIds ()
 
 getNavigationIds ()
 
 getLocalIds ()
 
 setPath ($pathType, $fullUrl)
 
 getPath ($pathType)
 
 getAllPaths ()
 
 removePath ($pathType)
 
 serialize ()
 
 unserialize ($serialized)
 

Public Attributes

const PATH_FILE = 'file_path'
 
const PATH_PAGE = 'page_path'
 
- Public Attributes inherited from Site
const TYPE_UNKNOWN = 'unknown'
 
const TYPE_MEDIAWIKI = 'mediawiki'
 
const GROUP_NONE = 'none'
 
const ID_INTERWIKI = 'interwiki'
 
const ID_EQUIVALENT = 'equivalent'
 
const SOURCE_LOCAL = 'local'
 
const PATH_LINK = 'link'
 
const SERIAL_VERSION_ID = '2013-01-23'
 

Additional Inherited Members

- Static Public Member Functions inherited from Site
static newForType ($siteType)
 
- Protected Attributes inherited from Site
 $globalId = null
 
 $type = self::TYPE_UNKNOWN
 
 $group = self::GROUP_NONE
 
 $source = self::SOURCE_LOCAL
 
 $languageCode = null
 
 $localIds = []
 
 $extraData = []
 
 $extraConfig = []
 
 $forward = false
 
 $internalId = null
 

Detailed Description

Class representing a MediaWiki site.

Since
1.21

Constructor & Destructor Documentation

MediaWikiSite::__construct (   $type = self::TYPE_MEDIAWIKI)
Since
1.21
Parameters
string$type

Member Function Documentation

MediaWikiSite::getFileUrl (   $path = false)

Returns the full file path (ie site url + relative file path). The path should go at the $1 marker. If the $path argument is provided, the marker will be replaced by it's value.

Since
1.21
Parameters
string | bool$path
Returns
string
MediaWikiSite::getLinkPathType ( )
See Also
Site::getLinkPathType Returns Site::PATH_PAGE
Since
1.21
Returns
string
MediaWikiSite::getPageUrl (   $pageName = false)
See Also
Site::getPageUrl

This implementation returns a URL constructed using the path returned by getLinkPath(). In addition to the default behavior implemented by Site::getPageUrl(), this method converts the $pageName to DBKey-format by replacing spaces with underscores before using it in the URL.

Since
1.21
Parameters
string | bool$pageNamePage name or false (default: false)
Returns
string
MediaWikiSite::getRelativeFilePath ( )

Returns the relative file path.

Since
1.21
Returns
string
MediaWikiSite::getRelativePagePath ( )

Returns the relative page path.

Since
1.21
Returns
string
MediaWikiSite::normalizePageName (   $pageName)

Returns the normalized form of the given page title, using the normalization rules of the given site. If the given title is a redirect, the redirect will be resolved and the redirect target is returned. Only titles of existing pages will be returned.

Note
This actually makes an API request to the remote site, so beware that this function is slow and depends on an external service.
If MW_PHPUNIT_TEST is defined, the call to the external site is skipped, and the title is normalized using the local normalization rules as implemented by the Title class.
See Also
Site::normalizePageName
Since
1.21
Parameters
string$pageName
Returns
string|false The normalized form of the title, or false to indicate an invalid title, a missing page, or some other kind of error.
Exceptions
MWException
MediaWikiSite::setFilePath (   $path)

Sets the relative file path.

Since
1.21
Parameters
string$path
MediaWikiSite::setPagePath (   $path)

Sets the relative page path.

Since
1.21
Parameters
string$path
MediaWikiSite::toDBKey (   $title)

Returns the database form of the given title.

Since
1.21
Parameters
string$titleThe target page's title, in normalized form.
Returns
string

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