Skip to content

Loading…

DCOM-210: ProxyFactory: Modes for NEVER, FILE_NOT_EXISTS, ALWAYS #516

Closed
doctrinebot opened this Issue · 9 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

@doctrinebot

Comment created by @ocramius:

Implemented in #291 - ( DCOM-209 )

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by mnapoli:

Any docs?

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

@doctrinebot

Comment created by @ocramius:

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

@doctrinebot

Comment created by @ocramius:

Created DDC-2664

@doctrinebot

Comment created by mnapoli:

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.

@doctrinebot

Comment created by mnapoli:

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

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-783] was closed:
doctrine/doctrine2#783

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-782] was closed:
doctrine/doctrine2#782

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.4 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.