Skip to content

Commit

Permalink
IBX-1694: Rebranded dependency injection container service tags (#10)
Browse files Browse the repository at this point in the history
Ibexa service container tags were rebranded to follow new naming convention.

For more details see https://issues.ibexa.co/browse/IBX-1694
  • Loading branch information
alongosz authored Jan 17, 2022
1 parent dbde823 commit 5fed6ec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ services:
class: EzSystems\PlatformMyHttpCacheBundle\PurgeClient\MyHttpCachePurgeClient
arguments: ['@ezplatform.http_cache.cache_manager']
tags:
- {name: ezplatform.http_cache.purge_client, purge_type: myhttpcache}
- {name: ibexa.cache.http.purge_client, purge_type: myhttpcache}
```

Any service which implements the PurgeClientInterface must be tagged with `ezplatform.http_cache.purge_client` in
Any service which implements the PurgeClientInterface must be tagged with `ibexa.cache.http.purge_client` in
order to be registered as such.

`purge_type` specifies what the value of the `ezpublish.http_cache.purge_type` setting in `app/config/ezplatform.yml`
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/DependencyInjection/Compiler/DriverPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function process(ContainerBuilder $container)
$container->removeAlias('ezpublish.http_cache.purge_client');

$purgeType = $container->getParameter('ezpublish.http_cache.purge_type');
$configuredPurgeClientServiceId = static::getTaggedService($container, 'ezplatform.http_cache.purge_client');
$configuredPurgeClientServiceId = static::getTaggedService($container, 'ibexa.cache.http.purge_client');
if ($configuredPurgeClientServiceId === null) {
throw new \InvalidArgumentException("No driver found being able to handle purge_type '$purgeType'.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symfony\Component\DependencyInjection\Reference;

/**
* Processes services tagged as ezplatform.cache_response_tagger, and registers them with the dispatcher.
* Injects services tagged as "ibexa.cache.http.response.tagger" into the dispatcher.
*/
class ResponseTaggersPass implements CompilerPassInterface
{
Expand All @@ -23,7 +23,7 @@ public function process(ContainerBuilder $container)

$taggers = [];

$taggedServiceIds = $container->findTaggedServiceIds('ezplatform.cache_response_tagger');
$taggedServiceIds = $container->findTaggedServiceIds('ibexa.cache.http.response.tagger');
foreach ($taggedServiceIds as $taggedServiceId => $tags) {
$taggers[] = new Reference($taggedServiceId);
}
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ services:
arguments:
- '@fos_http_cache.cache_manager'
tags:
- {name: ezplatform.http_cache.purge_client, purge_type: varnish}
- {name: ibexa.cache.http.purge_client, purge_type: varnish}

ezplatform.http_cache.purge_client.local:
class: Ibexa\HttpCache\PurgeClient\LocalPurgeClient
arguments: ['@ezplatform.http_cache.tag_aware_store']
tags:
- {name: ezplatform.http_cache.purge_client, purge_type: local}
- {name: ibexa.cache.http.purge_client, purge_type: local}

ezplatform.http_cache.tag_aware_store:
class: Toflar\Psr6HttpCacheStore\Psr6Store
Expand Down
8 changes: 4 additions & 4 deletions src/bundle/Resources/config/view_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ services:
class: Ibexa\HttpCache\ResponseTagger\Delegator\ContentValueViewTagger
arguments: ['@ezplatform.view_cache.response_tagger.content_info']
tags:
- {name: ezplatform.cache_response_tagger}
- {name: ibexa.cache.http.response.tagger}

ezplatform.view_cache.response_tagger.location_value_view:
class: Ibexa\HttpCache\ResponseTagger\Delegator\LocationValueViewTagger
arguments: ['@ezplatform.view_cache.response_tagger.location']
tags:
- {name: ezplatform.cache_response_tagger}
- {name: ibexa.cache.http.response.tagger}

# ResponseTagger value handlers
ezplatform.view_cache.response_tagger.abstract_value:
Expand All @@ -84,13 +84,13 @@ services:
class: Ibexa\HttpCache\ResponseTagger\Value\ContentInfoTagger
parent: ezplatform.view_cache.response_tagger.abstract_value
tags:
- {name: ezplatform.cache_response_tagger}
- {name: ibexa.cache.http.response.tagger}

ezplatform.view_cache.response_tagger.location:
class: Ibexa\HttpCache\ResponseTagger\Value\LocationTagger
parent: ezplatform.view_cache.response_tagger.abstract_value
tags:
- {name: ezplatform.cache_response_tagger}
- {name: ibexa.cache.http.response.tagger}

# Twig
ezplatform.view_cache.twig_extension:
Expand Down

0 comments on commit 5fed6ec

Please sign in to comment.