Doctrine 2. Auto generating proxies

前端 未结 3 571
鱼传尺愫
鱼传尺愫 2021-02-08 10:46

I have a strange problem. I want to turn off the auto generating of my proxies in Doctrine 2. I found this line of code that should do (and does) the trick:

$con         


        
3条回答
  •  借酒劲吻你
    2021-02-08 11:19

    If you rename the folder to something called "/temp" you will realize the difference between path and namespace.

    The path is the absolute path to the directory the proxies are getting generated into. The namespace is necessary to allow you to configure how an autoloader picks up these entities.

    The path in your case has to be something like "proxies/Proxies" and the namespace is then "Proxies". Your autoloader has to be configured to listen to namespace prefix "Proxies" at directory "proxies/".

    This is all mood with Doctrine 2 RC1 though, we found a way to explicitly load a proxy path without help of an autoloader at no additional cost. The Proxy Namespace configuratino is therefore only necessary to make sure no other classes are in the same namespace as the proxies.

提交回复
热议问题