作曲家:如何在Symfony 2.3中安装`dev`包? [英] Composer: how to install `dev` packages in Symfony 2.3?

查看:141
本文介绍了作曲家:如何在Symfony 2.3中安装`dev`包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在Symfony 2.3项目中安装 KnpGaufretteBundle ,我没有运气。问题是:


  1. minimum-stability:stable c> composer.json );

  2. 我需要的包是 dev-master / li>

阅读在Symfony文档中的这个是令人沮丧的:


如果你知道一个很酷的包或PHP库, a dev
最低稳定性,与首席开发人员交谈并说服他标记
a稳定版本。


不会将整个项目的最小稳定性改为 dev ,因为它肯定会造成巨大的<我的意思是,不能并排使用稳定的软件包和dev软件包?



我可能会错过作曲家吗? >




编辑(2013年8月14日)



根据 Sven 的答案,我编辑了我的 composer.json (您可以在这里找到它),它开始工作。无论如何,这是一个部分解决方案,因为内联别名不适用于依赖关系 - 所以在我的情况下,我必须首先指定所有依赖的小于稳定包,并一个一个别名。

解决方案

只需使用

  / knp-gaufrette-bundle:dev-master @ dev

版本



您还可以更改dev的最小稳定性并添加prefer-stable:true像这样:

 minimum-stability:dev,
prefer-stable:true,

那么composer将总是试图找到一个稳定的版本,如果没有找到安装dev,所以你的symfony包将仍然稳定。
但是在你的case composer将安装v0.1.4(最新稳定的knplabs / knp-gaufrette-bundle),所以你需要dev-master @ dev反正。喜欢稳定只是一个提示。


Trying to install the KnpGaufretteBundle in a Symfony 2.3 project, I'm having no luck. The problem is:

  1. minimum-stability:stable (in composer.json);
  2. the bundle I require is dev-master version still.

Reading this in the Symfony docs was frustrating:

If you know of a cool bundle or PHP library that still requires a dev minimum stability, talk to the lead developer and convince him to tag a stable release.

I'm not changing the minimum stability of the whole project to dev, as it would certainly make a huge mess - I mean, can't I use stable packages and dev packages side by side?

Am I missing something about composer maybe?


Edit (14 August 2013)

According to Sven's answer below, I've edited my composer.json (you can find it here) and it started to work. Anyway, this is a partial solution, because inline aliases do not work for dependencies - so in my case I'd have to specify all dependencies of "less-than-stable" packages first, and alias them one by one.

解决方案

just use

"knplabs/knp-gaufrette-bundle": "dev-master@dev" 

if you need the latest dev version

you can also change minimum-stability to dev and add "prefer-stable": true like this:

"minimum-stability": "dev",
"prefer-stable": true,

then composer will always try to find a stable version and if nothing found install dev, so your symfony packages will be still stable. But in your case composer will install v0.1.4 (latest stable of knplabs/knp-gaufrette-bundle), so you need dev-master@dev anyway. prefer-stable is just a hint for you.

这篇关于作曲家:如何在Symfony 2.3中安装`dev`包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆