我在这里 FOSRestBundle 做了一个 RLovelett/FOSRestBundle it has a branch dev-411
的分支。我想在 Symfony2 项目中使用 FOSRestBundle 的分支和分支。
为了尝试这个,我像这样修补了我的 symfony2 项目 composer.json
(完整的 composer.json
):
diff --git a/composer.json b/composer.json
index ec36007..19e82b5 100644
--- a/composer.json
+++ b/composer.json
@@ -23,7 +23,7 @@
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"jms/serializer-bundle": "0.12.x-dev",
- "friendsofsymfony/rest-bundle": "0.11.*"
+ "friendsofsymfony/rest-bundle": "dev-411"
},
"scripts": {
"post-install-cmd": [
@@ -42,12 +42,18 @@
"config": {
"bin-dir": "bin"
},
- "minimum-stability": "alpha",
+ "minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.2-dev"
}
- }
+ },
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/RLovelett/FOSRestBundle"
+ }
+ ]
}
当我运行
composer update
时,我收到以下错误消息:Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package friendsofsymfony/rest-bundle dev-411 could not be found.
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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
我的配置有什么问题?
最佳答案
Composer 在分支名称前加上 dev-
前缀以清楚地识别它们,因此如果分支是 dev-411
,那么它的 Composer 版本将是 dev-dev-411
。
关于php - Composer 在 Packagist 之前使用 Github,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15662485/