Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCOM-243: 'Zend OPcache' PHP extension might prevent AnnotationReader from getting entity class comments #85

Open
guilhermeblanco opened this issue Mar 27, 2016 · 1 comment
Assignees
Labels

Comments

@guilhermeblanco
Copy link
Member

From @doctrinebot on May 22, 2014 8:0

Jira issue originally created by user VictorSmirnov:

If module Zend OPcache is installed and configured not to save comments the AnnotationReader class fails to parse data for entities.

Output from php -m contains line Zend OPcache.
The module is configured with the following parameter opcache.save_comments=0.

I would expect the AnnotationReader constructor to throw an exception. But it does not check if the module is loaded.

In addition to the check for opcache module

        if (extension*loaded('opcache') && ini_get('opcache.save*comments') == 0) {
            throw AnnotationException::optimizerPlusSaveComments();
        }

we might have a new check for the Zend OPcache module

        if (extension*loaded('Zend OPcache') && ini_get('opcache.save*comments') == 0) {
            throw AnnotationException::optimizerPlusSaveComments();
        }

Copied from original issue: doctrine/common#551

@guilhermeblanco
Copy link
Member Author

From @doctrinebot on May 22, 2014 9:13

Comment created by VictorSmirnov:

Please check the pull request - #35
I think this might be a simple fix.

It took us a while here to discover the issue on production. I think the setup might be quite common on production servers. Adding the check should save people time on troubleshooting.

Warm regards,
Victor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants