Skip to content

Commit a2ddf97

Browse files
committed
Remove the dependency on the DoctrineBridge
1 parent 8ae4c6f commit a2ddf97

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@
2626
"require": {
2727
"php": "^5.5|^7",
2828
"symfony/framework-bundle": "^2.6|^3.0",
29-
"cache/psr-6-doctrine-bridge": "^0.1",
3029
"cache/taggable-cache": "^0.1",
3130
"psr/cache-implementation": "~1.0"
3231
},
3332
"require-dev": {
3433
"phpunit/phpunit": "^5.1|^4.0",
34+
"cache/psr-6-doctrine-bridge": "^0.1",
3535
"cache/doctrine-adapter": "^0.1"
3636
},
3737
"suggest": {
38-
"cache/doctrine-adapter-bundle": "A bundle to register PSR-6 compliant services based on Doctrine cache"
38+
"cache/doctrine-adapter-bundle": "A bundle to register PSR-6 compliant services based on Doctrine cache",
39+
"cache/psr-6-doctrine-bridge": "To be able to use Doctrine query, result and metadata cache."
3940
},
4041
"autoload": {
4142
"psr-4": {

src/DependencyInjection/Compiler/DoctrineSupportCompilerPass.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ protected function prepare()
4141
);
4242
}
4343

44+
if (!class_exists('Cache\Bridge\DoctrineCacheBridge')) {
45+
throw new \Exception(
46+
'You need the DoctrineBridge to be able to cache queries, results and metadata. Please run "composer.phar require cache/psr-6-doctrine-bridge" to install the missing dependency.'
47+
);
48+
}
49+
4450
$this->enableDoctrineSupport($this->container->getParameter('cache.doctrine'));
4551
}
4652

0 commit comments

Comments
 (0)