Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
190 views
in Technique[技术] by (71.8m points)

php - Symfony 2 - How to delete a bundle?

So my question is how to delete bundle I created?

You create bundles with this console command:

php app/console generate:bundle --namespace=Test/BlogBundle --format=yml

And thats awsome but what if I need to delete this bundle? Is there a console command to delete a bundle I dont need any more?

I know that when you create new bundle from console, you:

1. create /src/Test/BlogBundle directory
2. change /app/config/routing.yml file to include routes
3. include your new bundle in /app/Resources/App.Kernel.php
4. I think there is something changed in /app/cache/...

Now what would be correct way of deleting a bundle completely?

Its joust that using console these bundles are generated "magically" so I dont know what did this command changed in folder structure and files?

question from:https://stackoverflow.com/questions/12142425/symfony-2-how-to-delete-a-bundle

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is basically the process you have outlined, only in somewhat different order.

  1. delete /src/Test/BlogBundle directory
  2. change /app/config/routing.yml file to remove the bundle routes
  3. remove your new bundle from /app/AppKernel.php
  4. clear cache (either by deleting cache/{$env} or console cache:clear)

If this wasn't installed using a dependency manager - that should be all.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...