gpt4 book ai didi

composer-php - 通过 Github fork 加载 Composer 包

转载 作者:行者123 更新时间:2023-12-04 04:18:26 27 4
gpt4 key购买 nike

我在 Github 上 fork 了一个库,现在想将我的 fork 加载到项目中,而无需将 fork 库添加到 packagist 中。在将存储库添加到我的 composer.json 后,我收到以下错误:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package cnizzardini/ssl-certificate could not be found in any version, there may be a typo in the package name.

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

这是我的完整 composer.json
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": "~3.4",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*",
"guzzlehttp/guzzle": "^6.2",
"donatj/phpuseragentparser": "^0.7.0",
"cnizzardini/ssl-certificate": "dev-master"
},
"require-dev": {
"psy/psysh": "@stable",
"cakephp/debug_kit": "~3.2",
"cakephp/bake": "~1.1",
"phpunit/phpunit": "^5.5"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src",
"Api\\": "./plugins/Api/src",
"Channel\\": "./plugins/Channel/src",
"System\\": "./plugins/System/src",
"Admin\\": "./plugins/Admin/src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests",
"Api\\Test\\": "./plugins/Api/tests",
"Channel\\Test\\": "./plugins/Channel/tests",
"System\\Test\\": "./plugins/System/tests",
"Admin\\Test\\": "./plugins/Admin/tests"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
"minimum-stability": "stable",
"prefer-stable": true
}

我试过添加 https://github.com/cnizzardini/ssl-certificate有和没有 .git。我还尝试将最低稳定性设置为 dev 并将首选稳定设置为 false。

没有任何效果:-(

最佳答案

composer.json你的 fork 上的文件仍然调用包 "spatie/ssl-certificate" ,这就是您需要的包的名称。

这应该有效:

{
...
"require": {
...
"spatie/ssl-certificate": "dev-master"
},
...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
...
}

如果没有,您可以通过更改 name 来重命名您自己的 fork 上的包。属性(property)在其 composer.json文件:
{
"name": "cnizzardini/ssl-certificate",
"description": "A class to easily query the properties of an ssl certificate ",
...
}

关于composer-php - 通过 Github fork 加载 Composer 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45377221/

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