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

标签 php composer-php packagist

我将 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/

相关文章:

PHP Laravel eloquent with multiple databases,其实是select something

php - Symfony2 - Composer 清除缓存错误

github - 如何更改 packagist 的标签以获得稳定版本?

php - Composer/Packagist 找不到最低稳定性的包

php - 如何向 Packagist 添加新的包版本?

php - Appmobi Codeigniter 和 Facebook SDK JavaScript 与 PHP

PHP move_uploaded_file 文件系统

php - 如何从字符串中删除 <br/> 标签等?

composer-php - 通过 Composer 提取 silverstripe/upgrader 的 zip 文件时出错

javascript - 哪个包服务提供 Bower 的存储库?