X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMediaWikiServices.php;h=f9d9aab32e8d4383373f7d0b6fe0d8fbd595bdea;hb=116d54410216b1967e5f751f45cfa3ec6b463199;hp=7a4c2df8617c9ef3e8a4e226870b582edcecfd44;hpb=4533986087e6eec9c5bd2542705b4ab1dd7869a7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index 7a4c2df861..f9d9aab32e 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -15,6 +15,7 @@ use IBufferingStatsdDataFactory; use MediaWiki\Http\HttpRequestFactory; use MediaWiki\Preferences\PreferencesFactory; use MediaWiki\Shell\CommandFactory; +use MediaWiki\Special\SpecialPageFactory; use MediaWiki\Storage\BlobStore; use MediaWiki\Storage\BlobStoreFactory; use MediaWiki\Storage\NameTableStore; @@ -22,6 +23,7 @@ use MediaWiki\Storage\RevisionFactory; use MediaWiki\Storage\RevisionLookup; use MediaWiki\Storage\RevisionStore; use OldRevisionImporter; +use MediaWiki\Storage\RevisionStoreFactory; use UploadRevisionImporter; use Wikimedia\Rdbms\LBFactory; use LinkCache; @@ -38,6 +40,8 @@ use MimeAnalyzer; use ObjectCache; use Parser; use ParserCache; +use ParserFactory; +use PasswordFactory; use ProxyLookup; use SearchEngine; use SearchEngineConfig; @@ -51,6 +55,7 @@ use TitleFormatter; use TitleParser; use VirtualRESTServiceClient; use MediaWiki\Interwiki\InterwikiLookup; +use MagicWordFactory; /** * Service locator for MediaWiki core services. @@ -399,6 +404,30 @@ class MediaWikiServices extends ServiceContainer { // CONVENIENCE GETTERS //////////////////////////////////////////////////// + /** + * @since 1.31 + * @return ActorMigration + */ + public function getActorMigration() { + return $this->getService( 'ActorMigration' ); + } + + /** + * @since 1.31 + * @return BlobStore + */ + public function getBlobStore() { + return $this->getService( '_SqlBlobStore' ); + } + + /** + * @since 1.31 + * @return BlobStoreFactory + */ + public function getBlobStoreFactory() { + return $this->getService( 'BlobStoreFactory' ); + } + /** * Returns the Config object containing the bootstrap configuration. * Bootstrap configuration would typically include database credentials @@ -416,6 +445,22 @@ class MediaWikiServices extends ServiceContainer { return $this->getService( 'BootstrapConfig' ); } + /** + * @since 1.32 + * @return NameTableStore + */ + public function getChangeTagDefStore() { + return $this->getService( 'ChangeTagDefStore' ); + } + + /** + * @since 1.31 + * @return CommentStore + */ + public function getCommentStore() { + return $this->getService( 'CommentStore' ); + } + /** * @since 1.27 * @return ConfigFactory @@ -425,54 +470,68 @@ class MediaWikiServices extends ServiceContainer { } /** - * Returns the Config object that provides configuration for MediaWiki core. - * This may or may not be the same object that is returned by getBootstrapConfig(). - * - * @since 1.27 - * @return Config + * @since 1.32 + * @return ConfigRepository */ - public function getMainConfig() { - return $this->getService( 'MainConfig' ); + public function getConfigRepository() { + return $this->getService( 'ConfigRepository' ); } /** - * @since 1.27 - * @return SiteLookup + * @since 1.29 + * @return \ConfiguredReadOnlyMode */ - public function getSiteLookup() { - return $this->getService( 'SiteLookup' ); + public function getConfiguredReadOnlyMode() { + return $this->getService( 'ConfiguredReadOnlyMode' ); } /** - * @since 1.27 - * @return SiteStore + * @since 1.32 + * @return \Language */ - public function getSiteStore() { - return $this->getService( 'SiteStore' ); + public function getContentLanguage() { + return $this->getService( 'ContentLanguage' ); + } + + /** + * @since 1.31 + * @return NameTableStore + */ + public function getContentModelStore() { + return $this->getService( 'ContentModelStore' ); } /** * @since 1.28 - * @return InterwikiLookup + * @return CryptHKDF */ - public function getInterwikiLookup() { - return $this->getService( 'InterwikiLookup' ); + public function getCryptHKDF() { + return $this->getService( 'CryptHKDF' ); } /** - * @since 1.27 - * @return IBufferingStatsdDataFactory + * @since 1.28 + * @deprecated since 1.32, use random_bytes()/random_int() + * @return CryptRand */ - public function getStatsdDataFactory() { - return $this->getService( 'StatsdDataFactory' ); + public function getCryptRand() { + return $this->getService( 'CryptRand' ); } /** - * @since 1.32 - * @return IBufferingStatsdDataFactory + * @since 1.28 + * @return LoadBalancer The main DB load balancer for the local wiki. */ - public function getPerDbNameStatsdDataFactory() { - return $this->getService( 'PerDbNameStatsdDataFactory' ); + public function getDBLoadBalancer() { + return $this->getService( 'DBLoadBalancer' ); + } + + /** + * @since 1.28 + * @return LBFactory + */ + public function getDBLoadBalancerFactory() { + return $this->getService( 'DBLoadBalancerFactory' ); } /** @@ -484,85 +543,105 @@ class MediaWikiServices extends ServiceContainer { } /** - * @since 1.27 - * @return SearchEngine + * @since 1.31 + * @return \ExternalStoreFactory */ - public function newSearchEngine() { - // New engine object every time, since they keep state - return $this->getService( 'SearchEngineFactory' )->create(); + public function getExternalStoreFactory() { + return $this->getService( 'ExternalStoreFactory' ); } /** - * @since 1.27 - * @return SearchEngineFactory + * @since 1.28 + * @return GenderCache */ - public function getSearchEngineFactory() { - return $this->getService( 'SearchEngineFactory' ); + public function getGenderCache() { + return $this->getService( 'GenderCache' ); } /** - * @since 1.27 - * @return SearchEngineConfig + * @since 1.31 + * @return HttpRequestFactory */ - public function getSearchEngineConfig() { - return $this->getService( 'SearchEngineConfig' ); + public function getHttpRequestFactory() { + return $this->getService( 'HttpRequestFactory' ); } /** - * @since 1.27 - * @return SkinFactory + * @since 1.28 + * @return InterwikiLookup */ - public function getSkinFactory() { - return $this->getService( 'SkinFactory' ); + public function getInterwikiLookup() { + return $this->getService( 'InterwikiLookup' ); } /** * @since 1.28 - * @return LBFactory + * @return LinkCache */ - public function getDBLoadBalancerFactory() { - return $this->getService( 'DBLoadBalancerFactory' ); + public function getLinkCache() { + return $this->getService( 'LinkCache' ); } /** + * LinkRenderer instance that can be used + * if no custom options are needed + * * @since 1.28 - * @return LoadBalancer The main DB load balancer for the local wiki. + * @return LinkRenderer */ - public function getDBLoadBalancer() { - return $this->getService( 'DBLoadBalancer' ); + public function getLinkRenderer() { + return $this->getService( 'LinkRenderer' ); } /** * @since 1.28 - * @return WatchedItemStoreInterface + * @return LinkRendererFactory */ - public function getWatchedItemStore() { - return $this->getService( 'WatchedItemStore' ); + public function getLinkRendererFactory() { + return $this->getService( 'LinkRendererFactory' ); } /** * @since 1.28 - * @return WatchedItemQueryService + * @return \BagOStuff */ - public function getWatchedItemQueryService() { - return $this->getService( 'WatchedItemQueryService' ); + public function getLocalServerObjectCache() { + return $this->getService( 'LocalServerObjectCache' ); + } + + /** + * @since 1.32 + * @return MagicWordFactory + */ + public function getMagicWordFactory() { + return $this->getService( 'MagicWordFactory' ); + } + + /** + * Returns the Config object that provides configuration for MediaWiki core. + * This may or may not be the same object that is returned by getBootstrapConfig(). + * + * @since 1.27 + * @return Config + */ + public function getMainConfig() { + return $this->getService( 'MainConfig' ); } /** * @since 1.28 - * @deprecated since 1.32, use random_bytes()/random_int() - * @return CryptRand + * @return \BagOStuff */ - public function getCryptRand() { - return $this->getService( 'CryptRand' ); + public function getMainObjectStash() { + return $this->getService( 'MainObjectStash' ); } /** * @since 1.28 - * @return CryptHKDF + * @return \WANObjectCache */ - public function getCryptHKDF() { - return $this->getService( 'CryptHKDF' ); + public function getMainWANObjectCache() { + return $this->getService( 'MainWANObjectCache' ); } /** @@ -582,11 +661,11 @@ class MediaWikiServices extends ServiceContainer { } /** - * @since 1.28 - * @return ProxyLookup + * @since 1.32 + * @return OldRevisionImporter */ - public function getProxyLookup() { - return $this->getService( 'ProxyLookup' ); + public function getOldRevisionImporter() { + return $this->getService( 'OldRevisionImporter' ); } /** @@ -606,126 +685,108 @@ class MediaWikiServices extends ServiceContainer { } /** - * @since 1.28 - * @return GenderCache - */ - public function getGenderCache() { - return $this->getService( 'GenderCache' ); - } - - /** - * @since 1.28 - * @return LinkCache - */ - public function getLinkCache() { - return $this->getService( 'LinkCache' ); - } - - /** - * @since 1.28 - * @return LinkRendererFactory + * @since 1.32 + * @return ParserFactory */ - public function getLinkRendererFactory() { - return $this->getService( 'LinkRendererFactory' ); + public function getParserFactory() { + return $this->getService( 'ParserFactory' ); } /** - * LinkRenderer instance that can be used - * if no custom options are needed - * - * @since 1.28 - * @return LinkRenderer + * @since 1.32 + * @return PasswordFactory */ - public function getLinkRenderer() { - return $this->getService( 'LinkRenderer' ); + public function getPasswordFactory() { + return $this->getService( 'PasswordFactory' ); } /** - * @since 1.28 - * @return TitleFormatter + * @since 1.32 + * @return IBufferingStatsdDataFactory */ - public function getTitleFormatter() { - return $this->getService( 'TitleFormatter' ); + public function getPerDbNameStatsdDataFactory() { + return $this->getService( 'PerDbNameStatsdDataFactory' ); } /** - * @since 1.28 - * @return TitleParser + * @since 1.31 + * @return PreferencesFactory */ - public function getTitleParser() { - return $this->getService( 'TitleParser' ); + public function getPreferencesFactory() { + return $this->getService( 'PreferencesFactory' ); } /** * @since 1.28 - * @return \BagOStuff + * @return ProxyLookup */ - public function getMainObjectStash() { - return $this->getService( 'MainObjectStash' ); + public function getProxyLookup() { + return $this->getService( 'ProxyLookup' ); } /** - * @since 1.28 - * @return \WANObjectCache + * @since 1.29 + * @return \ReadOnlyMode */ - public function getMainWANObjectCache() { - return $this->getService( 'MainWANObjectCache' ); + public function getReadOnlyMode() { + return $this->getService( 'ReadOnlyMode' ); } /** - * @since 1.28 - * @return \BagOStuff + * @since 1.31 + * @return RevisionFactory */ - public function getLocalServerObjectCache() { - return $this->getService( 'LocalServerObjectCache' ); + public function getRevisionFactory() { + return $this->getService( 'RevisionFactory' ); } /** - * @since 1.28 - * @return VirtualRESTServiceClient + * @since 1.31 + * @return RevisionLookup */ - public function getVirtualRESTServiceClient() { - return $this->getService( 'VirtualRESTServiceClient' ); + public function getRevisionLookup() { + return $this->getService( 'RevisionLookup' ); } /** - * @since 1.29 - * @return \ConfiguredReadOnlyMode + * @since 1.31 + * @return RevisionStore */ - public function getConfiguredReadOnlyMode() { - return $this->getService( 'ConfiguredReadOnlyMode' ); + public function getRevisionStore() { + return $this->getService( 'RevisionStore' ); } /** - * @since 1.29 - * @return \ReadOnlyMode + * @since 1.32 + * @return RevisionStoreFactory */ - public function getReadOnlyMode() { - return $this->getService( 'ReadOnlyMode' ); + public function getRevisionStoreFactory() { + return $this->getService( 'RevisionStoreFactory' ); } /** - * @since 1.31 - * @return \UploadRevisionImporter + * @since 1.27 + * @return SearchEngine */ - public function getWikiRevisionUploadImporter() { - return $this->getService( 'UploadRevisionImporter' ); + public function newSearchEngine() { + // New engine object every time, since they keep state + return $this->getService( 'SearchEngineFactory' )->create(); } /** - * @since 1.31 - * @return \OldRevisionImporter + * @since 1.27 + * @return SearchEngineConfig */ - public function getWikiRevisionOldRevisionImporter() { - return $this->getService( 'OldRevisionImporter' ); + public function getSearchEngineConfig() { + return $this->getService( 'SearchEngineConfig' ); } /** - * @since 1.31 - * @return \OldRevisionImporter + * @since 1.27 + * @return SearchEngineFactory */ - public function getWikiRevisionOldRevisionImporterNoUpdates() { - return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' ); + public function getSearchEngineFactory() { + return $this->getService( 'SearchEngineFactory' ); } /** @@ -737,136 +798,123 @@ class MediaWikiServices extends ServiceContainer { } /** - * @since 1.31 - * @return \ExternalStoreFactory + * @since 1.27 + * @return SiteLookup */ - public function getExternalStoreFactory() { - return $this->getService( 'ExternalStoreFactory' ); + public function getSiteLookup() { + return $this->getService( 'SiteLookup' ); } /** - * @since 1.31 - * @return BlobStoreFactory + * @since 1.27 + * @return SiteStore */ - public function getBlobStoreFactory() { - return $this->getService( 'BlobStoreFactory' ); + public function getSiteStore() { + return $this->getService( 'SiteStore' ); } /** - * @since 1.31 - * @return BlobStore + * @since 1.27 + * @return SkinFactory */ - public function getBlobStore() { - return $this->getService( '_SqlBlobStore' ); + public function getSkinFactory() { + return $this->getService( 'SkinFactory' ); } /** * @since 1.31 - * @return RevisionStore + * @return NameTableStore */ - public function getRevisionStore() { - return $this->getService( 'RevisionStore' ); + public function getSlotRoleStore() { + return $this->getService( 'SlotRoleStore' ); } /** - * @since 1.31 - * @return RevisionLookup + * @since 1.32 + * @return SpecialPageFactory */ - public function getRevisionLookup() { - return $this->getService( 'RevisionLookup' ); + public function getSpecialPageFactory() : SpecialPageFactory { + return $this->getService( 'SpecialPageFactory' ); } /** - * @since 1.31 - * @return RevisionFactory + * @since 1.27 + * @return IBufferingStatsdDataFactory */ - public function getRevisionFactory() { - return $this->getService( 'RevisionFactory' ); + public function getStatsdDataFactory() { + return $this->getService( 'StatsdDataFactory' ); } /** - * @since 1.31 - * @return NameTableStore + * @since 1.28 + * @return TitleFormatter */ - public function getContentModelStore() { - return $this->getService( 'ContentModelStore' ); + public function getTitleFormatter() { + return $this->getService( 'TitleFormatter' ); } /** - * @since 1.31 - * @return NameTableStore + * @since 1.28 + * @return TitleParser */ - public function getSlotRoleStore() { - return $this->getService( 'SlotRoleStore' ); + public function getTitleParser() { + return $this->getService( 'TitleParser' ); } /** * @since 1.32 - * @return NameTableStore + * @return UploadRevisionImporter */ - public function getChangeTagDefStore() { - return $this->getService( 'ChangeTagDefStore' ); + public function getUploadRevisionImporter() { + return $this->getService( 'UploadRevisionImporter' ); } /** - * @since 1.31 - * @return PreferencesFactory + * @since 1.28 + * @return VirtualRESTServiceClient */ - public function getPreferencesFactory() { - return $this->getService( 'PreferencesFactory' ); + public function getVirtualRESTServiceClient() { + return $this->getService( 'VirtualRESTServiceClient' ); } /** - * @since 1.31 - * @return HttpRequestFactory + * @since 1.28 + * @return WatchedItemQueryService */ - public function getHttpRequestFactory() { - return $this->getService( 'HttpRequestFactory' ); + public function getWatchedItemQueryService() { + return $this->getService( 'WatchedItemQueryService' ); } /** - * @since 1.31 - * @return CommentStore + * @since 1.28 + * @return WatchedItemStoreInterface */ - public function getCommentStore() { - return $this->getService( 'CommentStore' ); + public function getWatchedItemStore() { + return $this->getService( 'WatchedItemStore' ); } /** * @since 1.31 - * @return ActorMigration - */ - public function getActorMigration() { - return $this->getService( 'ActorMigration' ); - } - - /** - * @since 1.32 - * @return UploadRevisionImporter + * @return \OldRevisionImporter */ - public function getUploadRevisionImporter() { - return $this->getService( 'UploadRevisionImporter' ); + public function getWikiRevisionOldRevisionImporter() { + return $this->getService( 'OldRevisionImporter' ); } /** - * @since 1.32 - * @return OldRevisionImporter + * @since 1.31 + * @return \OldRevisionImporter */ - public function getOldRevisionImporter() { - return $this->getService( 'OldRevisionImporter' ); + public function getWikiRevisionOldRevisionImporterNoUpdates() { + return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' ); } /** - * @return ConfigRepository + * @since 1.31 + * @return \UploadRevisionImporter */ - public function getConfigRepository() { - return $this->getService( 'ConfigRepository' ); + public function getWikiRevisionUploadImporter() { + return $this->getService( 'UploadRevisionImporter' ); } - /////////////////////////////////////////////////////////////////////////// - // NOTE: When adding a service getter here, don't forget to add a test - // case for it in MediaWikiServicesTest::provideGetters() and in - // MediaWikiServicesTest::provideGetService()! - /////////////////////////////////////////////////////////////////////////// - }