Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 904
Limeni Avatar asked Aug 27 '12 12:08

Limeni


People also ask

How do you delete a bundle?

To delete a bundle, you must first delete all of the WorkSpaces that are based on the bundle. Open the WorkSpaces console at https://console.aws.amazon.com/workspaces/ . In the navigation pane, choose Bundles. Select the bundle and choose Delete.

How do I remove a bundle composer?

Delete phpmd/phpmd from the vendor folder. Delete all the dependencies of phpmd/phpmd from composer. lock. Delete all the dependencies of phpmd/phpmd from the vendor folder.

What is a bundle in Symfony?

A Symfony bundle is a collection of files and folders organized in a specific structure. The bundles are modeled in such a way that it can be reused in multiple applications. The main application itself is packaged as a bundle and it is generally called AppBundle.


2 Answers

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.

like image 104
GregPK Avatar answered Sep 24 '22 05:09

GregPK


I know I am late to answer this but Symfony has instructions on how to delete the bundle. This is how I delete. You can use the same instructions for other bundles you created and want to remove now.

like image 44
Shairyar Avatar answered Sep 21 '22 05:09

Shairyar