Skip to content

Conversation

@ragboyjr
Copy link
Contributor

@ragboyjr ragboyjr commented Feb 17, 2017

Changes proposed in this pull request:

  • Added default cache parameter in createConfiguration

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 ArrayCache to prevent that behavior from occuring.

Signed-off-by: RJ Garcia rj@bighead.net

@ragboyjr ragboyjr changed the title Fixing default caching bug introduced from #205 [FIX] Fixing default caching bug introduced from #205 Feb 17, 2017
array_get($settings, 'dev', false),
array_get($settings, 'proxies.path')
array_get($settings, 'proxies.path'),
new ArrayCache()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably best to get the actual default cache driver then:

$defaultDriver = $this->config->get('doctrine.cache.default', 'array');
$this->cache->driver($driver);

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 <rj@bighead.net>
@ragboyjr
Copy link
Contributor Author

@patrickbrouwers no problem, can you check now?

@nghiaminhle
Copy link

nghiaminhle commented Feb 21, 2017

i have the same problem. Please add this line into EntityFactoryManager:

public function create(array $settings = [])
{
    $configuration = $this->setup->createConfiguration(
        array_get($settings, 'dev', false),
        array_get($settings, 'proxies.path'),
        **$this->cache->driver()**
    );

@patrickbrouwers patrickbrouwers merged commit b48a010 into laravel-doctrine:1.2 Feb 21, 2017
patrickbrouwers added a commit that referenced this pull request Feb 21, 2017
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 <rj@bighead.net>
@ragboyjr ragboyjr deleted the default-cache-fix branch February 21, 2017 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants