I’ve got a Symfony2 project and am trying to integrate the GuzzleBundle to build a web service client. I’m using the @guzzle annotations for the client commands (which extend Guzzle\Service\Command\AbstractCommand).
It seems to work correctly in the dev environment but when I try to load pages using the prod environment I get a Doctrine AnnotationException:
PHP Fatal error: Uncaught exception 'Doctrine\Common\Annotations\AnnotationException' with message '[Semantical Error] The annotation "@guzzle" in class Admin\FindAnExpertBundle\Entity\SymplecticClient\Rest\Command\UserById was never imported. Did you maybe forget to add a "use" statement for this annotation?'
I also get an error about a missing Proxy class file:
PHP Warning: require(/home/httpd/sites/experts.admin/app/cache/prod/doctrine/orm/Proxies/AdminFindAnExpertBundleEntityRelationshipTypeProxy.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/httpd/sites/experts.admin/vendor/doctrine/lib/Doctrine/ORM/Proxy/ProxyFactory.php
I assume this is because the fatal error is stopping all the proxy classes from being created.
Guzzle appears not to use the Doctrine annotation parser so I’m wondering if there’s a way to make it ignore @guzzle annotations or register them somehow?
I ended up moving the classes relating to the web service client out of the Entity folder, which stopped the Doctrine annotation parser from reading them. In retrospect, the classes shouldn’t have been in that folder anyway.