Skip to content

Commit 31fb87a

Browse files
Fixing default caching bug introduced from #205 (#211) (#213)
If you have memcached or redis extensions installed doctrine will try to automatically connect to one of them if no cache paramter is set when dev mode is off. Defaulting to the default driver to prevent that behavior from occuring. Signed-off-by: RJ Garcia <[email protected]>
1 parent c7bec6d commit 31fb87a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/EntityManagerFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace LaravelDoctrine\ORM;
44

5+
use Doctrine\Common\Cache\ArrayCache;
56
use Doctrine\Common\Cache\Cache;
67
use Doctrine\ORM\Cache\DefaultCacheFactory;
78
use Doctrine\ORM\Configuration;
@@ -92,9 +93,12 @@ public function __construct(
9293
*/
9394
public function create(array $settings = [])
9495
{
96+
$defaultDriver = $this->config->get('doctrine.cache.default', 'array');
97+
9598
$configuration = $this->setup->createConfiguration(
9699
array_get($settings, 'dev', false),
97-
array_get($settings, 'proxies.path')
100+
array_get($settings, 'proxies.path'),
101+
$this->cache->driver($defaultDriver)
98102
);
99103

100104
$this->setMetadataDriver($settings, $configuration);

0 commit comments

Comments
 (0)