Symfony 2 - 如何删除一个包? [英] 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?
推荐答案
这基本上就是您概述的过程,只是顺序略有不同.
It is basically the process you have outlined, only in somewhat different order.
- 删除/src/Test/BlogBundle 目录
- 更改/app/config/routing.yml 文件以删除捆绑路由
- 删除您的新包/app/AppKernel.php
- 清除缓存(通过删除缓存/{$env} 或控制台缓存:清除)
- delete /src/Test/BlogBundle directory
- change /app/config/routing.yml file to remove the bundle routes
- remove your new bundle from /app/AppKernel.php
- clear cache (either by deleting cache/{$env} or console cache:clear)
如果这不是使用依赖项管理器安装的 - 那应该就是全部了.
If this wasn't installed using a dependency manager - that should be all.
这篇关于Symfony 2 - 如何删除一个包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!