我有一個Symfony2項目,並且正在嘗試集成GuzzleBundle來構建Web服務客戶端。我將@guzzle
註釋用於客戶端命令(其擴展爲Guzzle\Service\Command\AbstractCommand
)。在Symfony2項目中不能與Doctrine2註解解析器一起使用的Guzzle註解
它似乎在開發環境中正常工作,但是當我嘗試使用PROD環境加載網頁,我得到一個主義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?'
我也得到有關失蹤Proxy
類文件的錯誤:
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
我認爲這是因爲致命錯誤是停止創建所有代理類。
Guzzle似乎不使用Doctrine註解解析器,所以我想知道是否有辦法讓它忽略@guzzle
註釋或以某種方式註冊它們?
感謝您的指針。我試圖找到負責guzzle註釋的類,但沒有任何運氣。事後看來,我認爲與Web服務客戶端相關的類應該不在實體文件夾中。 – StuBez 2012-07-30 11:45:14