使用Github在Packagist之前安装Composer

3

我在这里创建了FOSRestBundle的分支RLovelett/FOSRestBundle,它有一个名为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.

我的配置有什么问题?

2个回答

2

Composer在分支名称前加上dev-以清晰地识别它们,因此如果分支是dev-411,则其composer版本将为dev-dev-411


0

尝试了你的 (0.11.dev-feature/411),然后在阅读问题后,我尝试了几个 (dev-feature/411)。我甚至创建了一个同名的分支。但是没有成功,仍然出现相同的错误。 - Ryan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接