/**
* Class representing a MediaWiki site.
*
- * @since 1.20
+ * @since 1.21
*
* @file
* @ingroup Site
const PATH_PAGE = 'page_path';
/**
- * @since 1.20
+ * @since 1.21
*
* @param integer $globalId
*
/**
* Returns the database form of the given title.
*
- * @since 1.20
+ * @since 1.21
*
* @param String $title the target page's title, in normalized form.
*
*
* @see Site::normalizePageName
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pageName
*
/**
* Get normalization record for a given page title from an API response.
*
- * @since 1.20
+ * @since 1.21
*
* @param array $externalData A reply from the API on a external server.
* @param string $pageTitle Identifies the page at the external site, needing normalization.
* @see Site::getLinkPathType
* Returns Site::PATH_PAGE
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* Returns the relative page path.
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* Returns the relative file path.
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* Sets the relative page path.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $path
*/
/**
* Sets the relative file path.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $path
*/
* method converts the $pageName to DBKey-format by replacing spaces with underscores
* before using it in the URL.
*
- * @since 1.20
+ * @since 1.21
*
* @param string|false
*
* 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.20
+ * @since 1.21
*
* @param string|false $path
*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @since 1.20
+ * @since 1.21
*
* @file
* @ingroup Site
/**
* Returns the global site identifier (ie enwiktionary).
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* Sets the global site identifier (ie enwiktionary).
*
- * @since 1.20
+ * @since 1.21
*
* @param string $globalId
*/
/**
* Returns the type of the site (ie mediawiki).
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
* Sets the type of the site (ie mediawiki).
* TODO: remove, we cannot change this after instantiation
*
- * @since 1.20
+ * @since 1.21
*
* @param string $type
*/
/**
* Gets the type of the site (ie wikipedia).
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* Sets the type of the site (ie wikipedia).
*
- * @since 1.20
+ * @since 1.21
*
* @param string $group
*/
/**
* Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
*
- * @since 1.20
+ * @since 1.21
*
* @param string $source
*/
* Returns the protocol of the site, ie 'http://', 'irc://', '//'
* Or false if it's not known.
*
- * @since 1.20
+ * @since 1.21
*
* @return string|false
*/
* Returns the domain of the site, ie en.wikipedia.org
* Or false if it's not known.
*
- * @since 1.20
+ * @since 1.21
*
* @return string|false
*/
* This generated URL is usually based upon the path returned by getLinkPath(),
* but this is not a requirement.
*
- * @since 1.20
+ * @since 1.21
* @see Site::getLinkPath()
*
* @param bool|String $page
* Returns language code of the sites primary language.
* Or false if it's not known.
*
- * @since 1.20
+ * @since 1.21
*
* @return string|false
*/
/**
* Sets language code of the sites primary language.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $languageCode
*/
* Note that this method may call out to the target site to perform the normalization, so it may be slow
* and fail due to IO errors.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pageName
*
/**
* Returns the interwiki link identifiers that can be used for this site.
*
- * @since 1.20
+ * @since 1.21
*
* @return array of string
*/
* 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.20
+ * @since 1.21
*
* @return array of string
*/
/**
* Adds an local identifier to the site.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $type The type of the identifier, element of the Site::ID_ enum
* @param string $identifier
/**
* Adds an interwiki id to the site.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $identifier
*/
/**
* Adds a navigation id to the site.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $identifier
*/
/**
* Saves the site.
*
- * @since 1.20
+ * @since 1.21
*
* @param string|null $functionName
*/
/**
* Returns the internal ID of the site.
*
- * @since 1.20
+ * @since 1.21
*
* @return integer
*/
/**
* Sets the provided url as path of the specified type.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pathType
* @param string $fullUrl
/**
* Returns the path of the provided type or false if there is no such path.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pathType
*
*
* @param string $fullUrl
*
- * @since 1.20
+ * @since 1.21
*/
public function setLinkPath( $fullUrl );
* Returns the paths as associative array.
* The keys are path types, the values are the path urls.
*
- * @since 1.20
+ * @since 1.21
*
* @return array of string
*/
/**
* Removes the path of the provided type if it's set.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pathType
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @since 1.20
+ * @since 1.21
*
* @file
* @ingroup Site
/**
* Internal site identifiers pointing to their sites offset value.
*
- * @since 1.20
+ * @since 1.21
*
* @var array of integer
*/
/**
* Global site identifiers pointing to their sites offset value.
*
- * @since 1.20
+ * @since 1.21
*
* @var array of string
*/
/**
* @see GenericArrayObject::getObjectType
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* @see GenericArrayObject::preSetElement
*
- * @since 1.20
+ * @since 1.21
*
* @param int|string $index
* @param Site $site
/**
* @see ArrayObject::offsetUnset()
*
- * @since 1.20
+ * @since 1.21
*
* @param mixed $index
*/
/**
* @see SiteList::getGlobalIdentifiers
*
- * @since 1.20
+ * @since 1.21
*
* @return array
*/
/**
* @see SiteList::getSite
*
- * @since 1.20
+ * @since 1.21
*
* @param string $globalSiteId
*
/**
* @see SiteList::removeSite
*
- * @since 1.20
+ * @since 1.21
*
* @param string $globalSiteId
*/
/**
* @see SiteList::isEmpty
*
- * @since 1.20
+ * @since 1.21
*
* @return boolean
*/
/**
* @see SiteList::getSiteByInternalId
*
- * @since 1.20
+ * @since 1.21
*
* @param integer $id
*
/**
* @see SiteList::removeSiteByInternalId
*
- * @since 1.20
+ * @since 1.21
*
* @param integer $id
*/
/**
* @see SiteList::setSite
*
- * @since 1.20
+ * @since 1.21
*
* @param Site $site
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @since 1.20
+ * @since 1.21
*
* @file
* @ingroup Site
* Returns all the global site identifiers.
* Optionally only those belonging to the specified group.
*
- * @since 1.20
+ * @since 1.21
*
* @return array
*/
* Returns the Site with the provided global site identifier.
* The site needs to exist, so if not sure, call hasGlobalId first.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $globalSiteId
*
* Removes the site with the specified global site identifier.
* The site needs to exist, so if not sure, call hasGlobalId first.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $globalSiteId
*/
* Returns the Site with the provided site id.
* The site needs to exist, so if not sure, call has first.
*
- * @since 1.20
+ * @since 1.21
*
* @param integer $id
*
* Removes the site with the specified site id.
* The site needs to exist, so if not sure, call has first.
*
- * @since 1.20
+ * @since 1.21
*
* @param integer $id
*/
* Sets a site in the list. If the site was not there,
* it will be added. If it was, it will be updated.
*
- * @since 1.20
+ * @since 1.21
*
* @param Site $site
*/
/**
* Returns if the site list contains no sites.
*
- * @since 1.20
+ * @since 1.21
*
* @return boolean
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @since 1.20
+ * @since 1.21
*
* @file
* @ingroup Site
* Holds the local ids for this site.
* You can obtain them via @see getLocalIds
*
- * @since 1.20
+ * @since 1.21
*
* @var array|false
*/
/**
* @see Site::getGlobalId
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* @see Site::setGlobalId
*
- * @since 1.20
+ * @since 1.21
*
* @param string $globalId
*/
/**
* @see Site::getType
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* @see Site::setType
*
- * @since 1.20
+ * @since 1.21
*
* @param string $type
*/
/**
* @see Site::getGroup
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* @see Site::setGroup
*
- * @since 1.20
+ * @since 1.21
*
* @param string $group
*/
/**
* @see Site::getSource
*
- * @since 1.20
+ * @since 1.21
*
* @return string
*/
/**
* @see Site::setSource
*
- * @since 1.20
+ * @since 1.21
*
* @param string $source
*/
/**
* @see Site::getDomain
*
- * @since 1.20
+ * @since 1.21
*
* @return string|false
*/
/**
* @see Site::getProtocol
*
- * @since 1.20
+ * @since 1.21
*
* @return string|false
*/
*
* @param string $fullUrl
*
- * @since 1.20
+ * @since 1.21
*
* @throws MWException
*/
* This default implementation returns SiteObject::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.20
+ * @since 1.21
*
* @return string|false
*/
*
* This implementation returns a URL constructed using the path returned by getLinkPath().
*
- * @since 1.20
+ * @since 1.21
*
* @param bool|String $pageName
*
*
* @see Site::normalizePageName
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pageName
*
* Returns the value of a type specific field, or the value
* of the $default parameter in case it's not set.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $fieldName
* @param mixed $default
/**
* Sets the value of a type specific field.
- * @since 1.20
+ * @since 1.21
*
* @param string $fieldName
* @param mixed $value
/**
* @see Site::getLanguageCode
*
- * @since 1.20
+ * @since 1.21
*
* @return string|false
*/
/**
* @see Site::setLanguageCode
*
- * @since 1.20
+ * @since 1.21
*
* @param string $languageCode
*/
/**
* Returns the local identifiers of this site.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $type
*
/**
* Loads the local ids for the site.
*
- * @since 1.20
+ * @since 1.21
*/
protected function loadLocalIds() {
$dbr = wfGetDB( $this->getTable()->getReadDb() );
/**
* Adds a local identifier.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $type
* @param string $identifier
/**
* @see Site::addInterwikiId
*
- * @since 1.20
+ * @since 1.21
*
* @param string $identifier
*/
/**
* @see Site::addNavigationId
*
- * @since 1.20
+ * @since 1.21
*
* @param string $identifier
*/
/**
* @see Site::getInterwikiIds
*
- * @since 1.20
+ * @since 1.21
*
* @return array of string
*/
/**
* @see Site::getNavigationIds
*
- * @since 1.20
+ * @since 1.21
*
* @return array of string
*/
/**
* @see Site::getInternalId
*
- * @since 1.20
+ * @since 1.21
*
* @return integer
*/
* @see ORMRow::save
* @see Site::save
*
- * @since 1.20
+ * @since 1.21
*
* @param string|null $functionName
*
/**
* @see Site::setPath
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pathType
* @param string $fullUrl
/**
* @see Sitres::getPath
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pathType
*
/**
* @see Sitres::getAll
*
- * @since 1.20
+ * @since 1.21
*
* @return array of string
*/
/**
* @see Sitres::removePath
*
- * @since 1.20
+ * @since 1.21
*
* @param string $pathType
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @since 1.20
+ * @since 1.21
*
* @file
* @ingroup Site
class Sites {
/**
- * @since 1.20
+ * @since 1.21
* @var SiteList|false
*/
protected $sites = false;
/**
* Constructor.
*
- * @since 1.20
+ * @since 1.21
*/
protected function __construct() {}
/**
* Returns an instance of Sites.
*
- * @since 1.20
+ * @since 1.21
*
* @return Sites
*/
/**
* Factory for creating new site objects.
*
- * @since 1.20
+ * @since 1.21
*
* @param string|false $globalId
*
* fetched from the cache, which can be changed to loading
* the list from the database using the $useCache parameter.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $source either 'cache' or 'recache'
*
* Returns a list of sites in the given group. Calling getGroup() on any of
* the sites in the resulting SiteList shall return $group.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $group th group to get.
*
/**
* Fetches the site from the database and loads them into the sites field.
*
- * @since 1.20
+ * @since 1.21
*/
protected function loadSites() {
$this->sites = new SiteArray( SitesTable::singleton()->select() );
/**
* Returns the site with provided global id, or false if there is no such site.
*
- * @since 1.20
+ * @since 1.21
*
* @param string $globalId
* @param string $source
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @since 1.20
+ * @since 1.21
*
* @file
* @ingroup Site
/**
* @see IORMTable::getName()
- * @since 1.20
+ * @since 1.21
* @return string
*/
public function getName() {
/**
* @see IORMTable::getFieldPrefix()
- * @since 1.20
+ * @since 1.21
* @return string
*/
public function getFieldPrefix() {
/**
* @see IORMTable::getRowClass()
- * @since 1.20
+ * @since 1.21
* @return string
*/
public function getRowClass() {
/**
* @see IORMTable::getFields()
- * @since 1.20
+ * @since 1.21
* @return array
*/
public function getFields() {
/**
* @see IORMTable::getDefaults()
- * @since 1.20
+ * @since 1.21
* @return array
*/
public function getDefaults() {
/**
* Returns the class name for the provided site type.
*
- * @since 1.20
+ * @since 1.21
*
* @param integer $siteType
*
/**
* Factory method to construct a new Site instance.
*
- * @since 1.20
+ * @since 1.21
*
* @param array $data
* @param boolean $loadDefaults
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @since 1.20
+ * @since 1.21
*
* @ingroup Site
* @ingroup Test
*Both
* Bith
* @file
- * @since 1.20
+ * @since 1.21
*
* @ingroup Site
* @ingroup Test
/**
* @see GenericArrayObjectTest::elementInstancesProvider
*
- * @since 1.20
+ * @since 1.21
*
* @return array
*/
/**
* @see GenericArrayObjectTest::getInstanceClass
*
- * @since 1.20
+ * @since 1.21
*
* @return array
*/
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @since 1.20
+ * @since 1.21
*
* @ingroup Site
* @ingroup Test
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @since 1.20
+ * @since 1.21
*
* @ingroup Site
* @ingroup Test
/**
* @see ORMRowTest::getRowClass
- * @since 1.20
+ * @since 1.21
* @return string
*/
protected function getRowClass() {
/**
* @see ORMRowTest::getTableInstance
- * @since 1.20
+ * @since 1.21
* @return IORMTable
*/
protected function getTableInstance() {
/**
* @see ORMRowTest::constructorTestProvider
- * @since 1.20
+ * @since 1.21
* @return array
*/
public function constructorTestProvider() {
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @since 1.20
+ * @since 1.21
*
* @ingroup Site
* @ingroup Test
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @since 1.20
+ * @since 1.21
*
* @ingroup Site
* @ingroup Test
class TestSites {
/**
- * @since 1.20
+ * @since 1.21
*
* @return array
*/