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

Public Member Functions

 __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)
 

Static Public Member Functions

static newForType ($siteType)
 

Public Attributes

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'
 

Protected Attributes

 $globalId = null
 
 $type = self::TYPE_UNKNOWN
 
 $group = self::GROUP_NONE
 
 $source = self::SOURCE_LOCAL
 
 $languageCode = null
 
 $localIds = []
 
 $extraData = []
 
 $extraConfig = []
 
 $forward = false
 
 $internalId = null
 

Constructor & Destructor Documentation

Site::__construct (   $type = self::TYPE_UNKNOWN)

Constructor.

Since
1.21
Parameters
string$type

Member Function Documentation

Site::addInterwikiId (   $identifier)

Adds an interwiki id to the site.

Since
1.21
Parameters
string$identifier
Site::addLocalId (   $type,
  $identifier 
)

Adds a local identifier.

Since
1.21
Parameters
string$type
string$identifier
Site::addNavigationId (   $identifier)

Adds a navigation id to the site.

Since
1.21
Parameters
string$identifier
Site::getAllPaths ( )

Returns the paths as associative array. The keys are path types, the values are the path urls.

Since
1.21
Returns
string[]
Site::getDomain ( )

Returns the domain of the site, ie en.wikipedia.org Or false if it's not known.

Since
1.21
Returns
string|null
Site::getExtraConfig ( )

Returns the type specific config.

Since
1.21
Returns
array
Site::getExtraData ( )

Returns the type specific fields.

Since
1.21
Returns
array
Site::getGlobalId ( )

Returns the global site identifier (ie enwiktionary).

Since
1.21
Returns
string|null
Site::getGroup ( )

Gets the group of the site (ie wikipedia).

Since
1.21
Returns
string
Site::getInternalId ( )

Returns the set internal identifier for the site.

Since
1.21
Returns
string|null
Site::getInterwikiIds ( )

Returns the interwiki link identifiers that can be used for this site.

Since
1.21
Returns
string[]
Site::getLanguageCode ( )

Returns language code of the sites primary language. Or null if it's not known.

Since
1.21
Returns
string|null
Site::getLinkPath ( )

Returns the path used to construct links with or false if there is no such path.

Shall be equivalent to getPath( getLinkPathType() ).

Returns
string|null
Site::getLinkPathType ( )

Returns the main path type, that is the type of the path that should generally be used to construct links to the target site.

This default implementation returns Site::PATH_LINK as the default path type. Subclasses can override this to define a different default path type, or return false to disable site links.

Since
1.21
Returns
string|null
Site::getLocalIds ( )

Returns all local ids

Since
1.21
Returns
array[]
Site::getNavigationIds ( )

Returns the equivalent link identifiers that can be used to make the site show up in interfaces such as the "language links" section.

Since
1.21
Returns
string[]
Site::getPageUrl (   $pageName = false)

Returns the full URL for the given page on the site. Or false if the needed information is not known.

This generated URL is usually based upon the path returned by getLinkPath(), but this is not a requirement.

This implementation returns a URL constructed using the path returned by getLinkPath().

Since
1.21
Parameters
bool | string$pageName
Returns
string|bool
Site::getPath (   $pathType)

Returns the path of the provided type or false if there is no such path.

Since
1.21
Parameters
string$pathType
Returns
string|null
Site::getProtocol ( )

Returns the protocol of the site.

Since
1.21
Exceptions
MWException
Returns
string
Site::getSource ( )

Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').

Since
1.21
Returns
string
Site::getType ( )

Returns the type of the site (ie mediawiki).

Since
1.21
Returns
string
static Site::newForType (   $siteType)
static
Since
1.21
Parameters
string$siteType
Returns
Site
Site::normalizePageName (   $pageName)

Returns $pageName without changes. Subclasses may override this to apply some kind of normalization.

See Also
Site::normalizePageName
Since
1.21
Parameters
string$pageName
Returns
string
Site::removePath (   $pathType)

Removes the path of the provided type if it's set.

Since
1.21
Parameters
string$pathType
Site::serialize ( )
See Also
Serializable::serialize
Since
1.21
Returns
string
Site::setExtraConfig ( array  $extraConfig)

Sets the type specific config.

Since
1.21
Parameters
array$extraConfig
Site::setExtraData ( array  $extraData)

Sets the type specific fields.

Since
1.21
Parameters
array$extraData
Site::setForward (   $shouldForward)

Sets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier.

Since
1.21
Parameters
bool$shouldForward
Exceptions
MWException
Site::setGlobalId (   $globalId)

Sets the global site identifier (ie enwiktionary).

Since
1.21
Parameters
string | null$globalId
Exceptions
MWException
Site::setGroup (   $group)

Sets the group of the site (ie wikipedia).

Since
1.21
Parameters
string$group
Exceptions
MWException
Site::setInternalId (   $internalId = null)

Sets the internal identifier for the site. This typically is a primary key in a db table.

Since
1.21
Parameters
int | null$internalId
Site::setLanguageCode (   $languageCode)

Sets language code of the sites primary language.

Since
1.21
Parameters
string$languageCode
Site::setLinkPath (   $fullUrl)

Sets the path used to construct links with. Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).

Parameters
string$fullUrl
Since
1.21
Exceptions
MWException
Site::setPath (   $pathType,
  $fullUrl 
)

Sets the path used to construct links with. Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).

Since
1.21
Parameters
string$pathType
string$fullUrl
Exceptions
MWException
Site::setSource (   $source)

Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').

Since
1.21
Parameters
string$source
Exceptions
MWException
Site::shouldForward ( )

Gets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier.

Since
1.21
Returns
bool
Site::unserialize (   $serialized)
See Also
Serializable::unserialize
Since
1.21
Parameters
string$serialized

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