* @ingroup Site
*/
class MediaWikiSite extends Site {
-
const PATH_FILE = 'file_path';
const PATH_PAGE = 'page_path';
}
/**
- * 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 weill be resolved and the redirect target is returned.
+ * 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 weill be resolved and the redirect target is 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.
+ * @note This actually makes an API request to the remote site, so beware
+ * that this function is slow and depends on an external service.
*
- * @note : 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.
+ * @note 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 Site::normalizePageName
*
// Go on call the external site
if ( defined( 'MW_PHPUNIT_TEST' ) ) {
- // If the code is under test, don't call out to other sites, just normalize locally.
- // Note: this may cause results to be inconsistent with the actual normalization used by the respective remote site!
+ // If the code is under test, don't call out to other sites, just
+ // normalize locally.
+ // Note: this may cause results to be inconsistent with the actual
+ // normalization used by the respective remote site!
$t = Title::newFromText( $pageName );
return $t->getPrefixedText();
$page = static::extractPageRecord( $data, $pageName );
if ( isset( $page['missing'] ) ) {
- wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for a missing page title! " . $ret );
+ wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for a missing page title! "
+ . $ret );
return false;
}
if ( isset( $page['invalid'] ) ) {
- wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for an invalid page title! " . $ret );
+ wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for an invalid page title! "
+ . $ret );
return false;
}
return $filePath;
}
-
}
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class Site implements Serializable {
-
const TYPE_UNKNOWN = 'unknown';
const TYPE_MEDIAWIKI = 'mediawiki';
}
/**
- * Returns the main path type, that is the type of the path that should generally be used to construct links
- * to the target site.
+ * 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.
+ * 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
*
* @return string[]
*/
public function getInterwikiIds() {
- return array_key_exists( self::ID_INTERWIKI, $this->localIds ) ? $this->localIds[self::ID_INTERWIKI] : array();
+ return array_key_exists( self::ID_INTERWIKI, $this->localIds )
+ ? $this->localIds[self::ID_INTERWIKI]
+ : array();
}
/**
* @return string[]
*/
public function getNavigationIds() {
- return array_key_exists( self::ID_EQUIVALENT, $this->localIds ) ? $this->localIds[self::ID_EQUIVALENT] : array();
+ return array_key_exists( self::ID_EQUIVALENT, $this->localIds )
+ ? $this->localIds[self::ID_EQUIVALENT] :
+ array();
}
/**
$this->setForward( $fields['forward'] );
$this->setInternalId( $fields['internalid'] );
}
-
}
/**
* @deprecated
*/
-class SiteObject extends Site {}
+class SiteObject extends Site {
+}
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class SiteSQLStore implements SiteStore {
-
/**
* @since 1.21
*
}
if ( $siteRow->hasField( 'language' ) ) {
- $site->setLanguageCode( $siteRow->getField( 'language' ) === '' ? null : $siteRow->getField( 'language' ) );
+ $site->setLanguageCode( $siteRow->getField( 'language' ) === ''
+ ? null
+ : $siteRow->getField( 'language' )
+ );
}
if ( $siteRow->hasField( 'source' ) ) {
public function getSiteGroup( $group ) {
return $this->getSites()->getGroup( $group );
}
-
}