Skip to content

Loading…

DDC-2677: Doctrine\Common\Annotations\Reader::getMethodAnnotations sometimes doesn't return an array #3415

Open
doctrinebot opened this Issue · 6 comments

2 participants

@doctrinebot

Jira issue originally created by user shakaran:

Please read schmittjoh/JMSDiExtraBundle#133

@doctrinebot

Comment created by stof:

Are you using a cached annotation reader ? and if yes, which cache implementation is it ?

@doctrinebot

Comment created by shakaran:

Yes. I am using APC. In my config.yml for production:

doctrine:
    orm:
        metadata*cache*driver: apc
        result*cache*driver: apc
        query*cache*driver: apc
@doctrinebot

Comment created by stof:

I'm not talking about your ORM cache but about the annotation reader cache (for Symfony, it is configured in FrameworkBundle, and it defaults to a FileCacheReader if you don't configure it explicitly)

@doctrinebot

Comment created by shakaran:

Ok sorry. I am still very new with Symfony and Doctrine.

This is the framework config:
framework:
translator: { fallback: en }
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating:
engines: ['twig']
assets_version: v1.0
default_locale: %locale%
trusted_proxies:
session:

So it should be FileCacheReader as default config.

PS: I found this that could be related http://stackoverflow.com/questions/14070492/doctrine-annotations-filecachereader-php-invalid-argument

@doctrinebot

Comment created by jonathaningram:

I've noticed this issue since upgrading two things (not sure if either or both are relevant):

  1. PHP 5.3 --> 5.5.7
  2. Changed to memcached instead of apc for the 3 doctrine ORM cache drivers (note: I haven't touched the framework:annotations:cache configuration so it's the default "file")

I've tried to debug it but no luck figuring out what's going on. As far as I can see, the result is actually an empty array so I am not sure why PHP complains. Makes me wonder if it's a PHP 5.5 bug.

@doctrinebot

Comment created by @ocramius:

[~jonathaningram] can we reduce the scope of the problem? Try using an array cache to remove any caching/serialization related issues.

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.