I have a strange problem. I want to disable the auto-generation of my proxies in Doctrine 2. I found this line of code that should do (and does) the trick:
$config->setProxyDir(APPPATHSYSTEM."/proxies"); $config->setProxyNamespace('Proxies');
In my test environment, proxies are located in the application / proxy. i.e:.
application/proxies/BaseUserProxy.php
When I am in a live environment, my code suddenly looks for proxies in an application / proxy / Proxy, which is not the actual location.
I understand that this has something to do with the namespace, but I don't understand why it behaves differently when using the setAutoGenerateProxy method.
Any ideas?
change
I created new proxies with:
orm:generate-proxies
option.
Which gave me this result:
php doctrine.php orm:generate-proxies Processing entity "Base\Element" Processing entity "Base\Page" ... Processing entity "Base\Site" Proxy classes generated to "/var/www/application/proxies"
Looking at the last line, proxies are generated in / var / www / application / proxies. The list of directories is as follows:
BaseElementProxy.php BasePageProxy.php ... BaseSiteProxy.php
Therefore, there is no additional Proxies directory. But when I refresh my web page, she thinks she is, she gives me the following error:
Warning: require(/var/www/application//proxies/Proxies/BaseUserProxy.php) [function.require]: failed to open stream: No such file or directory in /var/www/library/Doctrine/Common/ClassLoader.php on line 148
Why is the optional Proxies directory added? If I create a proxy on every request, it does not look in the additional Proxies directory. Is anyone
@Bryan M .. This is not a solution, but a workaround. In addition, it does not work. When creating proxies, they will, if your suggestions are applied, be created in APPPATHSYSTEM, and my webapp will try to download them from APPPATHSYSTEM. "Proxy". The problem is that the system is looking for proxies in different places if I use:
$config->setAutoGenerateProxyClasses(DEVELOPMENT);
If DEVELOPMENT is true, he will watch APPPATHSYSTEM. If DEVELOPMENT is set to false, it will watch APPPATHSYSTEM. "Proxy". Just switching the DEVELOPMENT constant breaks my application, which theoretically should not be possible.