Symfony 2 - 如何删除一个包? [英] Symfony 2 - How to delete a bundle?

查看:29
本文介绍了Symfony 2 - 如何删除一个包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我的问题是如何删除我创建的包?

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.

  1. 删除/src/Test/BlogBu​​ndle 目录
  2. 更改/app/config/routing.yml 文件以删除捆绑路由
  3. 删除您的新包/app/AppKernel.php
  4. 清除缓存(通过删除缓存/{$env} 或控制台缓存:清除)
  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.

这篇关于Symfony 2 - 如何删除一个包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆