博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何使用composer从Laravel中删除包?
阅读量:2289 次
发布时间:2019-05-09

本文共 2818 字,大约阅读时间需要 9 分钟。

本文翻译自:

What is the right way to remove a package from Laravel 4? 从Laravel 4中删除包的正确方法是什么? So long I've tried: 我试过这么久了:

  1. Remove declaration from composer.json (in "require" section) composer.json删除声明(在“require”部分中)
  2. Remove any Class Aliases from app.php app.php删除任何类别名
  3. Remove any references to the package from my code :-) 从我的代码中删除对包的任何引用:-)
  4. Run composer update 运行composer update
  5. Run 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? 有没有办法“取消发布”他们?


#1楼

参考:


#2楼

Got it working... The steps to remove a package from Laravel are: 搞定了......从Laravel中删除包的步骤是:

  1. Remove declaration from composer.json (in "require" section) 从composer.json中删除声明(在“require”部分中)
  2. Remove Service Provider from "app/config/app.php" (reference in "providers" array) 从“app / config / app.php”中删除服务提供者 (在“providers”数组中引用)
  3. Remove any Class Aliases from "app/config/app.php" 从“app / config / app.php”中删除任何类别名
  4. Remove any references to the package from your code :-) 从您的代码中删除对包的任何引用:-)
  5. Run "composer update vendor/package-name". 运行“composer update vendor / package-name”。 This will remove the package folder from "vendor" folder and will rebuild composer autoloading map. 这将从“vendor”文件夹中删除包文件夹,并将重建composer autoloading map。
  6. Manually delete the published files (read comment by zwacky) 手动删除已发布的文件(阅读zwacky的评论)

It will remove the package folder from "Vendor" folder 它将从“Vendor”文件夹中删除包文件夹


#3楼

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

#4楼

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 供应商/包名称只是之前安装的目录


#5楼

如果在完成上述所有步骤后仍然出现错误,请转到项目bootstrap->cache->config.php手动从缓存的数组中删除提供程序和别名条目。


#6楼

You can do any one of the below two methods: 您可以执行以下两种方法中的任何一种:

  1. Running the below command (most recommended way to remove your package without updating your other packages) 运行以下命令(最常推荐的方法是在不更新其他软件包的情况下删除软件包)

    $ composer remove vendor/package

  2. 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/

你可能感兴趣的文章
Tomcat创建虚拟主机
查看>>
Tomcat集群
查看>>
Tomcat DeltaManager集群共享session
查看>>
Tomcat连接Apache之mod_proxy模块
查看>>
sersync+rsync数据同步
查看>>
使用com.aspose.words将word模板转为PDF文件时乱码解决方法
查看>>
Linux发送邮件
查看>>
YUM安装PHP5.6
查看>>
YUM源安装MySQL5.7
查看>>
Tomcat日志切割cronolog
查看>>
glibc-2.14安装
查看>>
升级openssl zlib版本 安装nginx
查看>>
ab压力测试
查看>>
SVN指定端口启动
查看>>
网站访问速度一般检查参数
查看>>
编译安装过程
查看>>
HTTP常见返回码信息
查看>>
WEB集群session处理方案
查看>>
JDK命令行(jps、jstat、jinfo、jmap、jhat、jstack、jstatd、hprof)与JConsole
查看>>
JAVA 对象访问: 句柄和指针
查看>>