Created
December 13, 2015 18:49
-
-
Save doctrinebot/16f3241c86ab0064c243 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-76 - https://github.com/doctrine/doctrine2/issues/5273
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: lib/Doctrine/ORM/Configuration.php | |
=================================================================== | |
--- lib/Doctrine/ORM/Configuration.php (revision 6579) | |
+++ lib/Doctrine/ORM/Configuration.php (working copy) | |
@@ -53,12 +53,6 @@ | |
'autoGenerateProxyClasses' => true, | |
'proxyNamespace' => null | |
)); | |
- | |
- //TODO: Move this to client code to avoid unnecessary work when a different metadata | |
- // driver is used. | |
- $reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache); | |
- $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); | |
- $this->_attributes['metadataDriverImpl'] = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader); | |
} | |
/** | |
@@ -126,10 +120,16 @@ | |
/** | |
* Gets the cache driver implementation that is used for the mapping metadata. | |
* | |
- * @return object | |
+ * @return \Doctrine\ORM\Mapping\Driver\AbstractFileDriver | |
*/ | |
public function getMetadataDriverImpl() | |
{ | |
+ if(!isset($this->_attributes['metadataDriverImpl'])) { | |
+ $reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache); | |
+ $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); | |
+ $this->_attributes['metadataDriverImpl'] = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader); | |
+ } | |
+ | |
return $this->_attributes['metadataDriverImpl']; | |
} | |
Index: lib/Doctrine/ORM/Configuration.php | |
=================================================================== | |
--- lib/Doctrine/ORM/Configuration.php (revision 6579) | |
+++ lib/Doctrine/ORM/Configuration.php (working copy) | |
@@ -53,12 +53,6 @@ | |
'autoGenerateProxyClasses' => true, | |
'proxyNamespace' => null | |
)); | |
- | |
- //TODO: Move this to client code to avoid unnecessary work when a different metadata | |
- // driver is used. | |
- $reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache); | |
- $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); | |
- $this->_attributes['metadataDriverImpl'] = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader); | |
} | |
/** | |
@@ -126,10 +120,16 @@ | |
/** | |
* Gets the cache driver implementation that is used for the mapping metadata. | |
* | |
- * @return object | |
+ * @return \Doctrine\ORM\Mapping\Driver\AbstractFileDriver | |
*/ | |
public function getMetadataDriverImpl() | |
{ | |
+ if(!isset($this->_attributes['metadataDriverImpl'])) { | |
+ $reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache); | |
+ $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); | |
+ $this->_attributes['metadataDriverImpl'] = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader); | |
+ } | |
+ | |
return $this->_attributes['metadataDriverImpl']; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment