29class Site implements Serializable {
49 const SERIAL_VERSION_ID =
'2013-01-23';
155 throw new MWException(
'$globalId needs to be string or null' );
194 throw new MWException(
'$group needs to be a string' );
222 throw new MWException(
'$source needs to be a string' );
251 if ( !
is_bool( $shouldForward ) ) {
252 throw new MWException(
'$shouldForward needs to be a boolean' );
269 if ( $path ===
null ) {
287 if ( $path ===
null ) {
291 $protocol =
parse_url( $path, PHP_URL_SCHEME );
294 if ( $protocol ===
false ) {
295 throw new MWException(
"failed to parse URL '$path'" );
299 if ( $protocol ===
null ) {
320 if (
$type ===
null ) {
321 throw new MWException(
"This Site does not support link paths." );
373 if ( $url ===
false ) {
377 if ( $pageName !==
false ) {
467 throw new InvalidArgumentException(
"$languageCode is not a valid language code." );
504 if ( $this->localIds ===
false ) {
505 $this->localIds = [];
509 $this->localIds[
$type] = [];
513 $this->localIds[
$type][] = $identifier;
525 $this->
addLocalId( self::ID_INTERWIKI, $identifier );
536 $this->
addLocalId( self::ID_EQUIVALENT, $identifier );
588 public function setPath( $pathType, $fullUrl ) {
590 throw new MWException(
'$fullUrl needs to be a string' );
594 $this->extraData[
'paths'] = [];
623 return array_key_exists(
'paths', $this->extraData ) ? $this->extraData[
'paths'] : [];
635 unset( $this->extraData[
'paths'][$pathType] );
694 $this->
setGroup( $fields[
'group'] );
697 $this->localIds = $fields[
'localids'];
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$wgSiteTypes
Register handlers for specific types of sites.
invalid e g too many</span ></p > !end !test with< references/> in group !wikitext Wikipedia rocks< ref > Proceeds of vol XXI</ref > Wikipedia rocks< ref group="note"> Proceeds of vol XXI</ref >< references/>< references group="note"/> ! html< p > Wikipedia rocks< sup id="cite_ref-1" class="reference">< a href="#cite_note-1"> &Wikipedia rocks< sup id="cite_ref-2" class="reference">< a href="#cite_note-2"> &</p >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-1">< span class="mw-cite-backlink">< a href="#cite_ref-1"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-2">< span class="mw-cite-backlink">< a href="#cite_ref-2"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div > !end !test with< references/> in group
normalizePageName( $pageName)
Attempt to normalize the page name in some fashion.
shouldForward()
Gets if site.tld/path/key:pageTitle should forward users to the page on the actual site,...
setPath( $pathType, $fullUrl)
Sets the path used to construct links with.
getExtraData()
Returns the type specific fields.
setGroup( $group)
Sets the group of the site (ie wikipedia).
addInterwikiId( $identifier)
Adds an interwiki id to the site.
getPath( $pathType)
Returns the path of the provided type or false if there is no such path.
setForward( $shouldForward)
Sets if site.tld/path/key:pageTitle should forward users to the page on the actual site,...
setSource( $source)
Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
getSource()
Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
static newForType( $siteType)
getProtocol()
Returns the protocol of the site.
getType()
Returns the type of the site (ie mediawiki).
removePath( $pathType)
Removes the path of the provided type if it's set.
addLocalId( $type, $identifier)
Adds a local identifier.
setLanguageCode( $languageCode)
Sets language code of the sites primary language.
getGlobalId()
Returns the global site identifier (ie enwiktionary).
setGlobalId( $globalId)
Sets the global site identifier (ie enwiktionary).
getLinkPathType()
Returns the main path type, that is the type of the path that should generally be used to construct l...
getExtraConfig()
Returns the type specific config.
addNavigationId( $identifier)
Adds a navigation id to the site.
getPageUrl( $pageName=false)
Returns the full URL for the given page on the site.
string null $languageCode
getAllPaths()
Returns the paths as associative array.
getLocalIds()
Returns all local ids.
unserialize( $serialized)
getGroup()
Gets the group of the site (ie wikipedia).
setInternalId( $internalId=null)
Sets the internal identifier for the site.
getLanguageCode()
Returns language code of the sites primary language.
getInternalId()
Returns the set internal identifier for the site.
setExtraConfig(array $extraConfig)
Sets the type specific config.
__construct( $type=self::TYPE_UNKNOWN)
getNavigationIds()
Returns the equivalent link identifiers that can be used to make the site show up in interfaces such ...
getDomain()
Returns the domain of the site, ie en.wikipedia.org Or false if it's not known.
getLinkPath()
Returns the path used to construct links with or false if there is no such path.
setLinkPath( $fullUrl)
Sets the path used to construct links with.
array[] $localIds
Holds the local ids for this site.
getInterwikiIds()
Returns the interwiki link identifiers that can be used for this site.
setExtraData(array $extraData)
Sets the type specific fields.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
foreach( $res as $row) $serialized