Skip to content

Add a api_platform.metadata_cache parameter #1725

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ private function registerBundlesConfiguration(array $bundles, array $config, Xml
private function registerCacheConfiguration(ContainerBuilder $container)
{
// Don't use system cache pool in dev
if (!$container->getParameter('kernel.debug')) {
if ($container->hasParameter('api_platform.metadata_cache') ? $container->getParameter('api_platform.metadata_cache') : !$container->getParameter('kernel.debug')) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@ private function getBaseContainerBuilderProphecy()
$containerBuilderProphecy->setAlias($alias, $service)->shouldBeCalled();
}

$containerBuilderProphecy->hasParameter('api_platform.metadata_cache')->willReturn(true)->shouldBeCalled();
$containerBuilderProphecy->getParameter('api_platform.metadata_cache')->willReturn(true)->shouldBeCalled();

return $containerBuilderProphecy;
}
}
2 changes: 2 additions & 0 deletions tests/Fixtures/app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ fos_user:
parameters:
container.autowiring.strict_mode: true
container.dumper.inline_class_loader: true
# Enable the metadata cache to speedup the builds
api_platform.metadata_cache: true

services:
contain_non_resource.item_data_provider:
Expand Down