[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/site/ -> Site.php (summary)

(no description)

File Size: 706 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

Site:: (38 methods):
  __construct()
  getGlobalId()
  setGlobalId()
  getType()
  getGroup()
  setGroup()
  getSource()
  setSource()
  shouldForward()
  setForward()
  getDomain()
  getProtocol()
  setLinkPath()
  getLinkPath()
  getLinkPathType()
  getPageUrl()
  normalizePageName()
  getExtraData()
  setExtraData()
  getExtraConfig()
  setExtraConfig()
  getLanguageCode()
  setLanguageCode()
  getInternalId()
  setInternalId()
  addLocalId()
  addInterwikiId()
  addNavigationId()
  getInterwikiIds()
  getNavigationIds()
  getLocalIds()
  setPath()
  getPath()
  getAllPaths()
  removePath()
  newForType()
  serialize()
  unserialize()

SiteObject:: (0 methods):


Class: Site  - X-Ref

Represents a single site.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
http://www.gnu.org/copyleft/gpl.html

__construct( $type = self::TYPE_UNKNOWN )   X-Ref
Constructor.

param: string $type

getGlobalId()   X-Ref
Returns the global site identifier (ie enwiktionary).

return: string|null

setGlobalId( $globalId )   X-Ref
Sets the global site identifier (ie enwiktionary).

param: string|null $globalId

getType()   X-Ref
Returns the type of the site (ie mediawiki).

return: string

getGroup()   X-Ref
Gets the type of the site (ie wikipedia).

return: string

setGroup( $group )   X-Ref
Sets the type of the site (ie wikipedia).

param: string $group

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

return: string

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

param: string $source

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

return: bool

setForward( $shouldForward )   X-Ref
Sets if site.tld/path/key:pageTitle should forward users to  the page on
the actual site, where "key" is the local identifier.

param: bool $shouldForward

getDomain()   X-Ref
Returns the domain of the site, ie en.wikipedia.org
Or false if it's not known.

return: string|null

getProtocol()   X-Ref
Returns the protocol of the site.

return: string

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

param: string $fullUrl

getLinkPath()   X-Ref
Returns the path used to construct links with or false if there is no such path.

Shall be equivalent to getPath( getLinkPathType() ).

return: string|null

getLinkPathType()   X-Ref
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.

return: string|null

getPageUrl( $pageName = false )   X-Ref
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().

param: bool|string $pageName
return: string|bool

normalizePageName( $pageName )   X-Ref
Returns $pageName without changes.
Subclasses may override this to apply some kind of normalization.

param: string $pageName
return: string

getExtraData()   X-Ref
Returns the type specific fields.

return: array

setExtraData( array $extraData )   X-Ref
Sets the type specific fields.

param: array $extraData

getExtraConfig()   X-Ref
Returns the type specific config.

return: array

setExtraConfig( array $extraConfig )   X-Ref
Sets the type specific config.

param: array $extraConfig

getLanguageCode()   X-Ref
Returns language code of the sites primary language.
Or null if it's not known.

return: string|null

setLanguageCode( $languageCode )   X-Ref
Sets language code of the sites primary language.

param: string $languageCode

getInternalId()   X-Ref
Returns the set internal identifier for the site.

return: string|null

setInternalId( $internalId = null )   X-Ref
Sets the internal identifier for the site.
This typically is a primary key in a db table.

param: int|null $internalId

addLocalId( $type, $identifier )   X-Ref
Adds a local identifier.

param: string $type
param: string $identifier

addInterwikiId( $identifier )   X-Ref
Adds an interwiki id to the site.

param: string $identifier

addNavigationId( $identifier )   X-Ref
Adds a navigation id to the site.

param: string $identifier

getInterwikiIds()   X-Ref
Returns the interwiki link identifiers that can be used for this site.

return: string[]

getNavigationIds()   X-Ref
Returns the equivalent link identifiers that can be used to make
the site show up in interfaces such as the "language links" section.

return: string[]

getLocalIds()   X-Ref
Returns all local ids

return: array[]

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

param: string $pathType
param: string $fullUrl

getPath( $pathType )   X-Ref
Returns the path of the provided type or false if there is no such path.

param: string $pathType
return: string|null

getAllPaths()   X-Ref
Returns the paths as associative array.
The keys are path types, the values are the path urls.

return: string[]

removePath( $pathType )   X-Ref
Removes the path of the provided type if it's set.

param: string $pathType

newForType( $siteType )   X-Ref

param: string $siteType
return: Site

serialize()   X-Ref

return: string

unserialize( $serialized )   X-Ref

param: string $serialized

Class: SiteObject  - X-Ref




Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1