Home » Php » php – Symfony2 without Doctrine

php – Symfony2 without Doctrine

Posted by: admin July 12, 2020 Leave a comment


How can I install symfony2 without Doctrine?

I have tried removing the package using composer and uninstalling the bundle manually but I get errors always.

My application is going to get the data from a Restful WS, so I don’t need Doctrine at all.

How to&Answers:
  1. Create a Symfony Standard Edition project with the Symfony installer:

    symfony new symfony-se

  2. Remove the doctrine/doctrine-bundle and doctrine/orm from your composer.json.

  3. Remove the DoctrineBundle from a list of registered bundles in AppKernel.

  4. Remove the doctrine configuration from the app/config/config.yml. You can also remove database related entries from the app/config/parameters.yml.dist.

  5. Run composer update.

Note that you’ll still find some of the doctrine packages installed. For example the doctrine/annotations library is used by Symfony to parse annotations. Doctrine is not only an ORM.