Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-861

Improve ProxyFactory to avoid having to use Autoloader

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-RC1
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

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

        Activity

        Hide
        Benjamin Eberlei added a comment -
        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
        +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
        @@ -77,9 +77,11 @@ class ProxyFactory
                 $proxyClassName = str_replace('\\', '', $className) . 'Proxy';
                 $fqn = $this->_proxyNamespace . '\\' . $proxyClassName;
         
        -        if ($this->_autoGenerate && ! class_exists($fqn, false)) {
        +        if (! class_exists($fqn, false)) {
                     $fileName = $this->_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . '.php';
        -            $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
        +            if ($this->_autoGenerate) {
        +                $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplat
        +            }
                     require $fileName;
                 }
        
        Show
        Benjamin Eberlei added a comment - 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 +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -77,9 +77,11 @@ class ProxyFactory $proxyClassName = str_replace('\\', '', $className) . 'Proxy'; $fqn = $ this ->_proxyNamespace . '\\' . $proxyClassName; - if ($ this ->_autoGenerate && ! class_exists($fqn, false )) { + if (! class_exists($fqn, false )) { $fileName = $ this ->_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . '.php'; - $ this ->_generateProxyClass($ this ->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate); + if ($ this ->_autoGenerate) { + $ this ->_generateProxyClass($ this ->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplat + } require $fileName; }
        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - I committed this yesterday. From now you don't need an autoloader for both autogenerate = true and = false.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: