I used to work with codeigniter. Now I am starting to learn Symfony2. I was just wondering is there any way to make the Symfony2 project a little bit smaller. Like, can I delete a couple of folders inside vendor. I am quite sure I am not using all of them. And if i do that, will it make the performance of the project a little bit faster? If the questions seems stupid then I am sorry. I am new to web development. Thanks in advance.

有帮助吗?

解决方案

In your composer.json you have by default a lot of libs, you simply have to remove what you won't need. For example,

  • symfony/monolog-bundle is for logging
  • symfony/swiftmailer-bundle is for sending emails
  • doctrine/orm and doctrine/doctrine-bundle are for handling objects persistence
  • jms/security-extra-bundle enhances the security component

Anything could be customized basing on your needs by simply removing the key:value pair in this file and later

$ cd your_project_dir; php app/console composer.phar update

It's not correct to simply remove the directories under vendor/, because composer reads from composer.json and re-creates the vendor/* dir every time you run it.

Linuxatico

Edit: one alternative is to use Silex, it's a php microframework based on Symfony2

其他提示

Removing unused libraries will not make your project run significantly faster so if I were you, I leave them alone. You will want to deal with that lot later after you gain some experience with Symfony 2.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top