本文共 2818 字,大约阅读时间需要 9 分钟。
本文翻译自:
What is the right way to remove a package from Laravel 4? 从Laravel 4中删除包的正确方法是什么? So long I've tried: 我试过这么久了:
composer.json
(in "require" section) 从composer.json
删除声明(在“require”部分中) app.php
从app.php
删除任何类别名 composer update
运行composer update
composer dump-autoload
运行composer dump-autoload
Not working! 不工作! Am I missing something? 我错过了什么吗?
Some packages publish their configuration via "artisan config:publish ...". 一些软件包通过“artisan config:publish ...”发布其配置。 Is there a way to "unpublish" them? 有没有办法“取消发布”他们?
参考:
Got it working... The steps to remove a package from Laravel are: 搞定了......从Laravel中删除包的步骤是:
It will remove the package folder from "Vendor" folder 它将从“Vendor”文件夹中删除包文件夹
Running the following command will remove the package from vendor (or wherever you install packages), composer.json and composer.lock. 运行以下命令将从供应商(或安装软件包的任何位置),composer.json和composer.lock中删除软件包。 Change vendor/package appropriately. 适当更改供应商/包裹。
composer remove vendor/package
Obviously you'll need to remove references to that package within your app. 显然,您需要删除应用中对该包的引用。
I'm currently running the following version of composer: 我目前正在运行以下版本的composer:
Composer version 1.0-dev (7b13507dd4d3b93578af7d83fbf8be0ca686f4b5) 2014-12-11 21:52:29
Running the following command 运行以下命令
composer remove Vendor/Package Name
That's all. 就这样。 No need composer update. 不需要作曲家更新。 Vendor/Package Name is just directory as installed before 供应商/包名称只是之前安装的目录
如果在完成上述所有步骤后仍然出现错误,请转到项目bootstrap->cache->config.php
手动从缓存的数组中删除提供程序和别名条目。
You can do any one of the below two methods: 您可以执行以下两种方法中的任何一种:
Running the below command (most recommended way to remove your package without updating your other packages) 运行以下命令(最常推荐的方法是在不更新其他软件包的情况下删除软件包)
$ composer remove vendor/package
Go to your composer.json file and then run command like below it will remove your package (but it will also update your other packages) 转到你的composer.json文件,然后运行如下命令它将删除你的包(但它也将更新你的其他包)
$ composer update
转载地址:http://lmcnb.baihongyu.com/