【发布时间】:2017-03-10 05:07:34
【问题描述】:
我正在尝试在另一个项目中需要我自己的包,原始包托管在 Bitbucket 中,并且有这个composer.json:
{
"name": "example/swagger-client",
"description": "",
"keywords": [
"swagger",
"php",
"sdk",
"api"
],
"homepage": "http://swagger.io",
"license": "Apache v2",
"authors": [
{
"name": "Swagger and contributors",
"homepage": "https://github.com/swagger-api/swagger-codegen"
}
],
"require": {
"php": ">=5.3.3",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"satooshi/php-coveralls": "~0.6.1",
"squizlabs/php_codesniffer": "~2.0"
},
"autoload": {
"psr-4": { "Swagger\\Client\\" : "lib/" }
}
}
这个包有分支master、develop和release/release-1.0.0。
使用这个包的项目有这个composer.json:
{
"name": "example/example-api-client",
"license": "proprietary",
"type": "symfony-bundle",
"description": "a description",
"keywords": ["Symfony", "bundle", "jwt", "jws", "authentication", "api", "rest"],
"repositories": [
{
"type": "git",
"url": "https://bitbucket.org/example/swaggerclient-example.git"
},
{
"type":"package",
"package":{
"name":"example/swagger-client",
"version": "dev",
"source":{
"type":"git",
"url":"https://bitbucket.org/example/swaggerclient-example.git",
"reference":"*"
}
}
}
],
"require": {
"php": ">=5.3.9",
"symfony/http-kernel": "2.8.*",
"symfony/security-bundle": "2.8.*",
"eightpoints/guzzle-bundle": "^5.3",
"example/swagger-client": "*"
},
"autoload": {
"psr-4": {
"ExampleOrg\\Bundle\\ExampleClientBundle\\": ""},
"exclude-from-classmap": [
"/Tests/"
]
},
"require-dev": {
"symfony/framework-bundle": "2.8.*",
"symfony/yaml": "2.8.*",
"phpunit/phpunit": "^4.8",
"symfony/phpunit-bridge": "~2.7",
"symfony/browser-kit": "2.8.*"
},
"autoload-dev": {
"psr-4": {
"ExampleOrg\\Bundle\\ExampleClientBundle\\Tests\\": "tests"
}
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev"
}
当尝试要求包 "example/swagger-client" 时出现错误:
[InvalidArgumentException]
在您的最低版本中找不到任何版本的包示例/swaggerclient-
稳定性(稳定)。检查包拼写或您的最低稳定性
另外,这个版本的命令falis:php composer.phar require example/swaggerclient=dev
首先,我如何知道存储库是不可访问还是可访问但其版本或 Composer 文件有问题?
其次,我该如何解决这个问题?
【问题讨论】:
-
自动生成的 PHP 客户端应该附带一个 README 文件,其中包含有关如何包含发布到 git repo 的包的安装说明。这会有帮助吗?
标签: php composer-php