From d1fb130cb4456b7cd4089fcc43468e4592c5c970 Mon Sep 17 00:00:00 2001 From: Kyle Spraggs Date: Fri, 4 Nov 2011 09:11:29 -0500 Subject: [PATCH] Removed the default annotation driver. --- configs/module.config.php | 13 ++++++------- docs/INSTALL.md | 8 ++++++-- src/SpiffyDoctrine/Service/Doctrine.php | 5 ++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/configs/module.config.php b/configs/module.config.php index 9ea8e33..aa9352d 100644 --- a/configs/module.config.php +++ b/configs/module.config.php @@ -34,13 +34,12 @@ 'proxy-dir' => __DIR__ . '/src/SpiffyDoctrine/Proxy', 'proxy-namespace' => 'SpiffyDoctrine\Proxy', 'metadata-driver-impl' => array( - 'doctrine-annotationdriver' => array( - 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', - 'namespace' => 'SpiffyDoctrine', - 'paths' => array(), - 'cache-class' => 'Doctrine\Common\Cache\ArrayCache', - 'cache-namespace' => 'doctrine_annotation', - ) + // 'application-annotation-driver' => array( + // 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', + // 'namespace' => 'My\Entity\Namespace', + // 'paths' => array('/path/to/entities'), + // 'cache-class' => 'Doctrine\Common\Cache\ArrayCache', + // ) ), 'metadata-cache-impl' => 'Doctrine\Common\Cache\ArrayCache', 'query-cache-impl' => 'Doctrine\Common\Cache\ArrayCache', diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 9029ae1..d192ebb 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -25,9 +25,13 @@ SpiffyDoctrine key to your modules array before your Application module key. ), 'config' => array( 'metadata-driver-impl' => array( - 'doctrine-annotationdriver' => array( + // to add multiple drivers just follow the format below and give them a different keyed name + // cache-class is only required for annotation drivers + 'application-annotation-driver' => array( + 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', 'namespace' => 'My\Entity\Namespace', - 'paths' => array('path/to/your/entities') + 'paths' => array('/some/path/to/entities'), + 'cache-class' => 'Doctrine\Common\Cache\ArrayCache', ) ) ) diff --git a/src/SpiffyDoctrine/Service/Doctrine.php b/src/SpiffyDoctrine/Service/Doctrine.php index 393738e..a4181b5 100644 --- a/src/SpiffyDoctrine/Service/Doctrine.php +++ b/src/SpiffyDoctrine/Service/Doctrine.php @@ -103,8 +103,7 @@ class Doctrine */ protected $_annotationDriverDefinition = array( 'required' => array( - 'cache-class' => 'string', - 'cache-namespace' => 'string', + 'cache-class' => 'string' ) ); @@ -322,7 +321,7 @@ protected function _createEventManager(array $opts) /** * Creates a driver chain based on passed parameters. Drivers should, at minimum, * specify the class, namespace, and paths. AnnotationDrivers have two additional - * options 'cache-class' and 'cache-namespace' that are required. + * options 'cache-class' that are required. * * @todo allow setting own driver chain extended from ORM\Mapping\Driver\DriverChain * @param array $drivers