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

ProxyGenerator::isShortIdentifierGetter should check for file existance before reading the file #377

Open
VOONWerbeagentur opened this issue Sep 1, 2015 · 2 comments

Comments

@VOONWerbeagentur
Copy link

We are using a module which is generating entity classes at runtime with Zend\Code\Generator which are only eval()'d and not persisted to the file system. When calling doctrine-module orm:generate:proxies lots of warnings are issued because the class files do not exist. Therefore, ProxyGenerator::isShortIdentifierGetter should check existance of class files before reading them with file().

Simply adding && file_exists($method->getDeclaringClass()->getFileName()) to the initialization of $cheapCheck does prevent those warnings.

@Ocramius
Copy link
Member

Ocramius commented Sep 1, 2015

@VOONWerbeagentur can you look for other getFileName calls throughout the source?

@VOONWerbeagentur
Copy link
Author

@Ocramius: In doctrine/common, I found only two other calls of getFileName:

  1. Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver::getAllClassNames
  2. Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver::getAllClassNames (which is obviously a copy of the first one)

But I think the calls made there are no Problem, as the file name is not used for reading the file.

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

No branches or pull requests

2 participants