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

Closed
opened 2026-01-22 13:00:50 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 5, 2010).

Originally assigned to: @beberlei on GitHub.

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?

Originally created by @doctrinebot on GitHub (Nov 5, 2010). Originally assigned to: @beberlei on GitHub. 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?
admin added the Improvement label 2026-01-22 13:00:50 +01:00
admin closed this issue 2026-01-22 13:00:51 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 5, 2010):

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;
         }
@doctrinebot commented on GitHub (Nov 5, 2010): 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; } ```
Author
Owner

@doctrinebot commented on GitHub (Nov 6, 2010):

Comment created by @beberlei:

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

@doctrinebot commented on GitHub (Nov 6, 2010): Comment created by @beberlei: I committed this yesterday. From now you don't need an autoloader for both autogenerate = true and = false.
Author
Owner

@doctrinebot commented on GitHub (Nov 6, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Nov 6, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1068