我想要求我自己的包在另一個項目中,原包裝在到位桶主辦,有這個composer.json
: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]
Could not find package example/swaggerclient at any version for your minimum-
stability (stable). Check the package spelling or your minimum-stability
另外,此版本的命令falis的:php composer.phar require example/swaggerclient=dev
首先,我如何知道存儲庫是不可訪問的還是可訪問的,但其版本有問題或其Composer文件?
二,我該如何解決這個問題?
自動生成的PHP客戶端應該隨附一個README文件,其中包含有關如何將包發佈到git repo的安裝說明。這會有幫助嗎? –