Details
Description
Proxy classes are generated in less than 1ms for me. I prefer to not have a "build" step to reducing loading time by a milisecond, so I use autogenerate.
For users like me, wouldn't it be nicer if we wouldn't even have to configure a proxy dir and those files were never written (since they're not read more than once anyway)?
Activity
Benjamin Eberlei
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Roman S. Borschel [ romanb ] | Benjamin Eberlei [ beberlei ] |
| Affects Version/s | 2.1 [ 10022 ] | |
| Affects Version/s | 2.0-BETA2 [ 10050 ] |
Benjamin Eberlei
made changes -
| Affects Version/s | 2.1 [ 10022 ] | |
| Fix Version/s | 2.1 [ 10022 ] |
Roman S. Borschel
made changes -
| Priority | Minor [ 4 ] | Major [ 3 ] |
Benjamin Eberlei
made changes -
| Fix Version/s | 2.x [ 10090 ] | |
| Fix Version/s | 2.1 [ 10022 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 11676 ] | jira-feedback [ 13866 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 13866 ] | jira-feedback2 [ 15730 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 15730 ] | jira-feedback3 [ 17987 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-717, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
This very minimal patch removes the use of these temporary files:
--- library/Doctrine/ORM/Proxy/ProxyFactory.php (revision 2) +++ library/Doctrine/ORM/Proxy/ProxyFactory.php (working copy) @@ -78,9 +78,8 @@ $fqn = $this->_proxyNamespace . '\\' . $proxyClassName; if ($this->_autoGenerate && ! class_exists($fqn, false)) { - $fileName = $this->_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . '.php'; - $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate); - require $fileName; + $file = $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, null, self::$_proxyClassTemplate); + eval('?>'.$file); } if ( ! $this->_em->getMetadataFactory()->hasMetadataFor($fqn)) { @@ -144,6 +143,9 @@ $file = str_replace($placeholders, $replacements, $file); + if ($fileName === null) + return $file; + file_put_contents($fileName, $file); }