I am currently working on a project using Symfony2 and I have no need for the Doctrine Bundle. I have tried to remove it on numerous occasions but I keep getting errors that break the install.
I have grep'ed for all instances of 'Doctrine' within the app directory and have commented out any reference to Doctrine in the following files:
I then cleared the cache (currently working in dev mode, so removed the cache/dev directory).
The Error I am currently getting is:
Fatal error: Class 'Doctrine\Common\Annotations\FileCacheReader' not found in /path/to/application/app/cache/dev/appDevDebugProjectContainer.php on line 45
This refers to this block of code in the cache
/**
* Gets the 'annotation_reader' service.
*
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Doctrine\Common\Annotations\FileCacheReader A Doctrine\Common\Annotations\FileCacheReader instance.
*/
protected function getAnnotationReaderService()
{
return $this->services['annotation_reader'] = new \Doctrine\Common\Annotations\FileCacheReader(new \Doctrine\Common\Annotations\AnnotationReader(), '/path/to/application/app/cache/dev/annotations', true);
}
but I cannot find a way to stop this from being added to the cache, as I cannot find any settings relating to the annotation_reader
.
Symfony uses Doctrine's annotation library. You don't need Doctrine's ORM or DBAL and you can remove them. But you need annotation reader if you use annotations anywhere in your project.
EDIT: You'll have to test it on your own. I never tried it myself.
These bundles seem to use annotation reader:
Note that it's probably not worth the effort. If you're not using given services they're not created.
You might wanna have a look at: http://fabien.potencier.org/article/50/create-your-own-framework-on-top-of-the-symfony2-components-part-1
and
http://silex.sensiolabs.org/
;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With