X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Fsite%2FFileBasedSiteLookup.php;h=174d66765117d7e08aa5b73f664529587d2f2c73;hb=02210976ab8a2d865c53df85dfb21dae2f0d709b;hp=424d8e69b3d91def8b1b5f1949f598bc6713cd38;hpb=7ed5eb1e71523d43d6d80783079a189b2224e0da;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/site/FileBasedSiteLookup.php b/includes/site/FileBasedSiteLookup.php index 424d8e69b3..174d667651 100644 --- a/includes/site/FileBasedSiteLookup.php +++ b/includes/site/FileBasedSiteLookup.php @@ -17,18 +17,14 @@ * * @file * - * @license GNU GPL v2+ + * @license GPL-2.0-or-later */ /** - * Provides a file-based cache of a SiteStore. The sites are stored in - * a json file. (see docs/sitescache.txt regarding format) - * - * The cache can be built with the rebuildSitesCache.php maintenance script, - * and a MediaWiki instance can be setup to use this by setting the - * 'wgSitesCacheFile' configuration to the cache file location. + * Provides a file-based cache of a SiteStore, using a json file. * * @since 1.25 + * @deprecated since 1.33 Use CachingSiteStore instead. */ class FileBasedSiteLookup implements SiteLookup { @@ -42,15 +38,11 @@ class FileBasedSiteLookup implements SiteLookup { */ private $cacheFile; - /** - * @var string[] - */ - private $languageCodeMapping = []; - /** * @param string $cacheFile */ public function __construct( $cacheFile ) { + wfDeprecated( __CLASS__, '1.33' ); $this->cacheFile = $cacheFile; } @@ -123,18 +115,13 @@ class FileBasedSiteLookup implements SiteLookup { * @return Site */ private function newSiteFromArray( array $data ) { - $languageCode = $data['language']; - if ( isset( $this->languageCodeMapping[ $languageCode ] ) ) { - $languageCode = $this->languageCodeMapping[ $languageCode ]; - } - $siteType = array_key_exists( 'type', $data ) ? $data['type'] : Site::TYPE_UNKNOWN; $site = Site::newForType( $siteType ); $site->setGlobalId( $data['globalid'] ); $site->setForward( $data['forward'] ); $site->setGroup( $data['group'] ); - $site->setLanguageCode( $languageCode ); + $site->setLanguageCode( $data['language'] ); $site->setSource( $data['source'] ); $site->setExtraData( $data['data'] ); $site->setExtraConfig( $data['config'] ); @@ -146,13 +133,4 @@ class FileBasedSiteLookup implements SiteLookup { return $site; } - /** - * Provide an array that maps language codes - * - * @param string[] $newMapping - */ - public function setLanguageCodeMapping( array $newMapping ) { - $this->languageCodeMapping = $newMapping; - } - }