Skip to content
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

Fix non existent service when using symfony cache pools #964

Merged
merged 1 commit into from May 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions DependencyInjection/DoctrineExtension.php
Expand Up @@ -739,7 +739,7 @@ protected function loadCacheDriver($driverName, $entityManagerName, array $drive
break;

case 'pool':
$serviceId = $this->createPoolCacheDefinition($container, $aliasId, $driverMap['pool']);
$serviceId = $this->createPoolCacheDefinition($container, $driverMap['pool']);
break;

case 'provider':
Expand Down Expand Up @@ -862,15 +862,15 @@ private function loadMessengerServices(ContainerBuilder $container) : void
$transportFactoryDefinition->addTag('messenger.transport_factory');
}

private function createPoolCacheDefinition(ContainerBuilder $container, string $aliasId, string $poolName) : string
private function createPoolCacheDefinition(ContainerBuilder $container, string $poolName) : string
{
if (! class_exists(DoctrineProvider::class)) {
throw new LogicException('Using the "pool" cache type is only supported when symfony/cache is installed.');
}

$serviceId = sprintf('doctrine.orm.cache.pool.%s', $poolName);

$definition = $container->register($aliasId, DoctrineProvider::class);
$definition = $container->register($serviceId, DoctrineProvider::class);
$definition->addArgument(new Reference($poolName));
$definition->setPrivate(true);

Expand Down