Skip to content


DDC-861: Improve ProxyFactory to avoid having to use Autoloader #5383

doctrinebot opened this Issue · 3 comments

2 participants


Jira issue originally created by user @beberlei:

In ProxyFactory::getProxy all the information is necessary to avoid having to configure an autoloader. Why don't we do that already?


Comment created by @beberlei:

diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
index 472e730..8be75d9 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php
<ins></ins><ins> b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -77,9 </ins>77,11 @@ class ProxyFactory
         $proxyClassName = str_replace('\\', '', $className) . 'Proxy';
         $fqn = $this->_proxyNamespace . '\\' . $proxyClassName;

-        if ($this->*autoGenerate && ! class*exists($fqn, false)) {
<ins>        if (! class_exists($fqn, false)) {
             $fileName = $this->*proxyDir . DIRECTORY*SEPARATOR . $proxyClassName . '.php';
-            $this->*generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$*proxyClassTemplate);
</ins>            if ($this->_autoGenerate) {
<ins>                $this->*generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$*proxyClassTemplat
</ins>            }
             require $fileName;

Comment created by @beberlei:

I committed this yesterday. From now you don't need an autoloader for both autogenerate = true and = false.


Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-RC1 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.