在Symfony2上更新composer.phar [英] Updating the composer.phar on Symfony2

查看:61
本文介绍了在Symfony2上更新composer.phar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已经开始的Symfony2项目。我需要安装新捆绑包,并且我看到我需要添加一个

I have an already started Symfony2 project. I need to install a new bundle, and as I saw i need to add a new line to my composer.json and then execute the update command.

问题是,我的composer.phar文件和.json位于不同的文件夹中。

The thing is, my composer.phar file and the .json are on different folders.

/httpdocs/composer.json
/bin/composer.phar

因此,在将此行添加到.json文件后:

So after I add this line to the .json file:

"doctrine/mongodb-odm-bundle": "3.0.*@dev"

我尝试 / bin / php composer.phar update doctrine / mongodb-odm-bundle 我收到一个错误消息,说composer.json不存在,当然是正确的。所以我怀疑为什么选择的文件位于不同的文件夹中?以前的开发人员会犯错误吗?我应该将文件移动到同一文件夹吗?要 bin httpdocs

If then i try /bin/php composer.phar update doctrine/mongodb-odm-bundle i got an error saying that the composer.json is not there and is correct of course. So my doubt is WHY thoose files are in different folders? does the previous developer make a mistake? Should I move the files to a same folder? To bin or httpdocs?

推荐答案

composer.phar 的住处无关紧要。相关的部分是您的当前工作目录在symfony项目中( composer.json 所在的位置)。然后是简单的执行作曲者(如果设置了执行位,则无需调用php)。

It doesn't matter where the composer.phar lives. The relevant part, that your current working directory is in the symfony project (where the composer.json lives). Then simple execute composer (if the execute bit is set, no call to php is required).

/bin/composer.phar update doctrine/mongodb-odm-bundle

这篇关于在Symfony2上更新composer.phar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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