gpt4 book ai didi

php - 如何在 Packagist 中重命名 PHP 包

转载 作者:可可西里 更新时间:2023-11-01 01:11:25 26 4
gpt4 key购买 nike

我将 composer 文件中的 PHP 包名称从 "name": "author/author-php" 更改为 "name": "author/author" 然后做了composer install & composer update,将我的更改与 master 合并,然后创建一个版本。

但是在 Packagist 上更新库后,新名称不起作用, Composer 无法在 composer require author/author 找到它,我什至无法下载这个新版本。

注意:repo 名称仍然是 author-php 那么这就是 Packagist 没有重命名它的原因吗?

最佳答案

截至目前,您不能更新包名,我相信是出于安全原因(如果允许重命名,有害代码可能会作为旧名称,然后尚未更新其 composer.json 的依赖项目将拉有害代码)。已在 Packagist's Github page 上讨论过,这种操作的流程是这个(从上面的链接复制粘贴):

  • Update the name in composer.json on the master branch or whatever the default branch is
  • Resubmitting the package to packagist using the new name
  • Mark the old package as "Abandoned" on packagist, and use the new name in the form so that people get pointed to it when they install with the old name
  • And no you can't keep your download stats

关于php - 如何在 Packagist 中重命名 PHP 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55378780/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com