本文介绍了作曲家在Packagist之前使用Github的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 FOSRestBundle 的分支。 / RLovelett / FOSRestBundle / tree / dev-411 rel = nofollow> Rlovelett / FOSRestBundle,它有一个分支 dev-411 。我想在Symfony2项目中使用FOSRestBundle的分支和分支。

I have made a fork of FOSRestBundle here RLovelett/FOSRestBundle it has a branch dev-411. I want to use my fork and branch of FOSRestBundle in a Symfony2 project.

为了尝试执行此操作,我修补了symfony2项目 composer.json 这样(完整的):

To attempt this I patched my symfony2 project composer.json like so (full 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 时,出现以下错误消息:

When I run composer update I get the following error message:

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.

我的配置有什么问题?

What is wrong with my configuration?

推荐答案

Composer将前缀 dev-前缀为分支名称以清楚地标识它们,因此,如果分支为 dev-411 ,则其编写器版本为 dev-dev-411

Composer prefixes dev- to branch names to identify them clearly, so if the branch is dev-411, the composer version for it would be dev-dev-411.

这篇关于作曲家在Packagist之前使用Github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 19:16