#DDC-2664 Document new Proxy factory flags usage as of DCOM-210
[Document new Proxy factory flags usage as of DCOM-210](http://www.doctrine-project.org/jira/browse/DDC-2664)
This commit is contained in:
parent
87d2ff8665
commit
4a0a4094da
@ -329,24 +329,51 @@ controls this behavior is:
|
|||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$config->setAutoGenerateProxyClasses($bool);
|
$config->setAutoGenerateProxyClasses($mode);
|
||||||
$config->getAutoGenerateProxyClasses();
|
|
||||||
|
|
||||||
The default value is ``TRUE`` for convenient development. However,
|
Possible values are:
|
||||||
this setting is not optimal for performance and therefore not
|
|
||||||
recommended for a production environment. To eliminate the overhead
|
- ``Doctrine\Common\Proxy\AbstractProxyFactory::AUTOGENERATE_NEVER``
|
||||||
of proxy class generation during runtime, set this configuration
|
|
||||||
option to ``FALSE``. When you do this in a development environment,
|
Never autogenerate a proxy and rely that it was generated by some
|
||||||
note that you may get class/file not found errors if certain proxy
|
process before deployment.
|
||||||
classes are not available or failing lazy-loads if new methods were
|
|
||||||
added to the entity class that are not yet in the proxy class. In
|
To generate the proxies, use:
|
||||||
such a case, simply use the Doctrine Console to (re)generate the
|
|
||||||
proxy classes like so:
|
|
||||||
|
|
||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
|
When you do this in a development environment,
|
||||||
|
note that you may get class/file not found errors if certain proxy
|
||||||
|
classes are not available or failing lazy-loads if new methods were
|
||||||
|
added to the entity class that are not yet in the proxy class.
|
||||||
|
In such a case, simply use the Doctrine Console to (re)generate the
|
||||||
|
proxy classes.
|
||||||
|
|
||||||
$ ./doctrine orm:generate-proxies
|
$ ./doctrine orm:generate-proxies
|
||||||
|
|
||||||
|
- ``Doctrine\Common\Proxy\AbstractProxyFactory::AUTOGENERATE_ALWAYS``
|
||||||
|
|
||||||
|
Always generates a new proxy in every request.
|
||||||
|
|
||||||
|
- ``Doctrine\Common\Proxy\AbstractProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS``
|
||||||
|
|
||||||
|
Autogenerate the proxy class when the proxy file does not exist.
|
||||||
|
This strategy causes a file exists call whenever any proxy is
|
||||||
|
used the first time in a request.
|
||||||
|
|
||||||
|
- ``Doctrine\Common\Proxy\AbstractProxyFactory::AUTOGENERATE_EVAL``
|
||||||
|
|
||||||
|
Generate the proxy classes using eval(), which avoids writing the
|
||||||
|
proxies to disk. This strategy is only sane for development.
|
||||||
|
|
||||||
|
In a production environment, it is highly recommended to use
|
||||||
|
AUTOGENERATE_NEVER to allow for optimal performances. The other
|
||||||
|
options are interesting in development environment.
|
||||||
|
|
||||||
|
Before v2.4, ``setAutoGenerateProxyClasses`` would accept a boolean
|
||||||
|
value. This is still possible, ``FALSE`` being equivalent to
|
||||||
|
AUTOGENERATE_NEVER and ``TRUE`` to AUTOGENERATE_ALWAYS.
|
||||||
|
|
||||||
Autoloading Proxies
|
Autoloading Proxies
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user