如何使用 Composer 更新单个库? [英] How to update a single library with Composer?
本文介绍了如何使用 Composer 更新单个库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只需要为我的 SF2 发行版 (DoctrineFixtures) 安装 1 个包.
I need to install only 1 package for my SF2 distribution (DoctrineFixtures).
当我跑步时
php composer.phar update
我明白
- Updating twig/twig (dev-master 39d94fa => v1.13.0)
The package has modified files:
M CHANGELOG
M doc/filters/batch.test
M doc/filters/index.rst
M doc/filters/url_encode.rst
M doc/functions/index.rst
M doc/tags/index.rst
M doc/tests/index.rst
M lib/Twig/Autoloader.php
M lib/Twig/Compiler.php
M lib/Twig/CompilerInterface.php
-10 more files modified, choose "v" to view the full list
看来最后一个开发人员在供应商内部编辑了很多文件.
It appears the last developer edited a lot of files inside vendor.
为了解决这个问题,我尝试了
In order to get around this, I tried
php composer.phar update <package_name>
但这似乎不起作用.如何仅从 composer.json 更新/安装一个库?
But that doesn't seem to work. How can I update/install only one library from composer.json?
推荐答案
安装 doctrine/doctrine-fixtures-bundle
版本 2.1.*
和最低稳定性 @dev
使用这个:
To install doctrine/doctrine-fixtures-bundle
with version 2.1.*
and minimum stability @dev
use this:
composer require doctrine/doctrine-fixtures-bundle:2.1.*@dev
然后只更新这个包:
composer update doctrine/doctrine-fixtures-bundle
这篇关于如何使用 Composer 更新单个库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文