Smalyshev has uploaded a new change for review. https://gerrit.wikimedia.org/r/284993
Change subject: Convert EventRelayerGroup to services infrastructure ...................................................................... Convert EventRelayerGroup to services infrastructure Change-Id: If55ddf441de69189c7fcdd3440f899c6b14f690f --- M includes/EventRelayerGroup.php M includes/MediaWikiServices.php M includes/ServiceWiring.php M includes/deferred/CdnCacheUpdate.php M tests/phpunit/includes/MediaWikiServicesTest.php 5 files changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/93/284993/1 diff --git a/includes/EventRelayerGroup.php b/includes/EventRelayerGroup.php index 9dfac79..aed3d67 100644 --- a/includes/EventRelayerGroup.php +++ b/includes/EventRelayerGroup.php @@ -23,6 +23,7 @@ } /** + * @deprecated since 1.27 Use MediaWikiServices::getInstance()->getEventRelayerGroup() * @return EventRelayerGroup */ public static function singleton() { diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index 3f4d8ed..9a942a5 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -152,6 +152,13 @@ return $this->getService( 'StatsdDataFactory' ); } + /** + * @return EventRelayerGroup + */ + public function getEventRelayerGroup() { + return $this->getService( 'EventRelayerGroup' ); + } + /////////////////////////////////////////////////////////////////////////// // NOTE: When adding a service getter here, don't forget to add a test // case for it in MediaWikiServicesTest::provideGetters() and in diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 7e1d4e3..9919171 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -78,6 +78,10 @@ ); }, + 'EventRelayerGroup' => function( MediaWikiServices $services ) { + return new EventRelayerGroup( $services->getMainConfig() ); + }, + /////////////////////////////////////////////////////////////////////////// // NOTE: When adding a service here, don't forget to add a getter function // in the MediaWikiServices class. The convenience getter should just call diff --git a/includes/deferred/CdnCacheUpdate.php b/includes/deferred/CdnCacheUpdate.php index 32f6adc..1ff4a87 100644 --- a/includes/deferred/CdnCacheUpdate.php +++ b/includes/deferred/CdnCacheUpdate.php @@ -22,6 +22,7 @@ */ use Wikimedia\Assert\Assert; +use MediaWiki\MediaWikiServices; /** * Handles purging appropriate CDN URLs given a title (or titles) @@ -109,7 +110,7 @@ wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) ); // Reliably broadcast the purge to all edge nodes - $relayer = EventRelayerGroup::singleton()->getRelayer( 'cdn-url-purges' ); + $relayer = MediaWikiServices::getInstance()->getEventRelayerGroup()->getRelayer( 'cdn-url-purges' ); $relayer->notify( 'cdn-url-purges', [ diff --git a/tests/phpunit/includes/MediaWikiServicesTest.php b/tests/phpunit/includes/MediaWikiServicesTest.php index 1889575..23b6318 100644 --- a/tests/phpunit/includes/MediaWikiServicesTest.php +++ b/tests/phpunit/includes/MediaWikiServicesTest.php @@ -25,6 +25,7 @@ 'SiteStore' => [ 'getSiteStore', SiteStore::class ], 'SiteLookup' => [ 'getSiteLookup', SiteLookup::class ], 'StatsdDataFactory' => [ 'getStatsdDataFactory', StatsdDataFactory::class ], + 'EventRelayerGroup' => [ 'EventRelayerGroup', EventRelayerGroup::class ], ]; } @@ -49,6 +50,7 @@ 'SiteStore' => [ 'SiteStore', SiteStore::class ], 'SiteLookup' => [ 'SiteLookup', SiteLookup::class ], 'StatsdDataFactory' => [ 'StatsdDataFactory', StatsdDataFactory::class ], + 'EventRelayerGroup' => [ 'EventRelayerGroup', EventRelayerGroup::class ], ]; } -- To view, visit https://gerrit.wikimedia.org/r/284993 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If55ddf441de69189c7fcdd3440f899c6b14f690f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Smalyshev <smalys...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits