[DCOM-210] ProxyFactory: Modes for NEVER, FILE_NOT_EXISTS, ALWAYS Created: 07/Aug/13  Updated: 09/Sep/13  Resolved: 25/Aug/13

Status: Resolved
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: 2.4

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Comments   
Comment by Marco Pivetta [ 25/Aug/13 ]

Implemented in https://github.com/doctrine/common/pull/291 - ( DCOM-209 )

Comment by Matthieu Napoli [ 09/Sep/13 ]

Any docs?

It seems that it can't be used with Doctrine\ORM\Configuration

Comment by Marco Pivetta [ 09/Sep/13 ]

I think this should work in v2.4.0: see https://github.com/doctrine/doctrine2/blob/v2.4.0/lib/Doctrine/ORM/EntityManager.php#L163

I'll open an issue to document these new flags

Comment by Marco Pivetta [ 09/Sep/13 ]

Created DDC-2664

Comment by Matthieu Napoli [ 09/Sep/13 ]

Actually found it, it's not documented and not really foolproof:

$doctrineConfig = new Doctrine\ORM\Configuration();
$doctrineConfig->setAutoGenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_EVAL);

However it will not work if the proxy autoloader is registered (which was necessary before, so if you forget to remove it, you'll get confusing errors that the proxy file can't be found), and you need to set a proxy dir else there's an exception:

exception 'Doctrine\Common\Proxy\Exception\InvalidArgumentException' with message 'You must configure a proxy directory. See docs for details'
$doctrineConfig->setProxyDir('/tmp/proxies');

The docs needs updating, both in code and on the website. If I find some time today I'll try to do it.

Comment by Matthieu Napoli [ 09/Sep/13 ]

Woops, commented at the same time, will copy my comment to the other ticket for better tracking.

Comment by Doctrine Bot [ 09/Sep/13 ]

A related Github Pull-Request [GH-783] was closed:
https://github.com/doctrine/doctrine2/pull/783

Comment by Doctrine Bot [ 09/Sep/13 ]

A related Github Pull-Request [GH-782] was closed:
https://github.com/doctrine/doctrine2/pull/782

Generated at Wed Jul 30 21:37:27 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.