Skip to content

Commit 305b78a

Browse files
committed
Merge pull request #9 from php-cache/patch1
Remove the dependency on the DoctrineBridge
2 parents 8ae4c6f + 51e63dd commit 305b78a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

composer.json

Lines changed: 5 additions & 4 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": {
34-
"phpunit/phpunit": "^5.1|^4.0",
35-
"cache/doctrine-adapter": "^0.1"
33+
"phpunit/phpunit": "^5.1|^4.0",
34+
"cache/psr-6-doctrine-bridge": "^2.0",
35+
"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 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)