8000 [FrameworkBundle] integrate the Cache component by xabbuh · Pull Request #17868 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] integrate the Cache component #17868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FrameworkBundle] Add PSR-6 cache pool proxying
  • Loading branch information
nicolas-grekas committed Mar 10, 2016
commit 6bf21a485eda2500887b973f0710ab775522d37a
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,9 @@ private function addCacheSection(ArrayNodeDefinition $rootNode)
->end()
->children()
->enumNode('type')
->info('The cache pool type (one of "apcu", "doctrine" or "filesystem")')
->info('The cache pool type (one of "apcu", "doctrine", "psr6" or "filesystem")')
10000 ->isRequired()
->values(array('apcu', 'doctrine', 'filesystem'))
->values(array('apcu', 'doctrine', 'psr6', 'filesystem'))
->end()
->integerNode('default_lifetime')->default(0)->end()
->scalarNode('cache_provider_service')->defaultNull()->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
$poolDefinition = new DefinitionDecorator('cache.adapter.'.$poolConfig['type']);
$poolDefinition->replaceArgument(1, $poolConfig['default_lifetime']);

if ('doctrine' === $poolConfig['type']) {
if ('doctrine' === $poolConfig['type'] || 'psr6' === $poolConfig['type']) {
$poolDefinition->replaceArgument(0, new Reference($poolConfig['cache_provider_service']));
} elseif ('filesystem' === $poolConfig['type'] && isset($poolConfig['directory'][0])) {
$poolDefinition->replaceArgument(0, $poolConfig['directory']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@

<service id="cache.adapter.doctrine" class="Symfony\Component\Cache\Adapter\DoctrineAdapter" abstract="true">
<tag name="cache.adapter" namespace-arg-index="2"></tag>
<argument /> <!-- doctrine provider -->
<argument /> <!-- doctrine provider service -->
<argument /> <!-- default lifetime -->
<argument /> <!-- namespace -->
</service>

<service id="cache.adapter.psr6" class="Symfony\Component\Cache\Adapter\ProxyAdapter" abstract="true">
<tag name="cache.adapter" namespace-arg-index="2"></tag>
<argument /> <!-- PSR-6 provider service -->
<argument /> <!-- default lifetime -->
<argument /> <!-- namespace -->
</service>
Expand Down
0