如何使用Composer更新单个库? [英] How to update a single library with Composer?
本文介绍了如何使用Composer更新单个库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要为我的SF2分发(DoctrineFixtures)只安装一个包。
当我运行
< p $ p>
php composer.phar update
- 更新twig / twig(dev-master 39d94fa => v1.13.0)
程序包已修改文件:
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更多文件修改,选择v查看完整列表
显示最后一个开发人员在供应商中编辑了大量文件。
为了解决这个问题,我尝试了
php composer.phar update< package_name>
但似乎无效。
如何从composer.json更新/安装1个库?
解决方案
安装doctrine / doctrine-fixtures -bdele与版本2.1。*和最低稳定性@dev使用:
composer.phar require doctrine / doctrine-fixtures-bundle:2.1。* @ dev
p>
composer.phar update doctrine / doctrine-fixtures-bundle
I need to install only 1 package for my SF2 distribution (DoctrineFixtures).
When I run
php composer.phar update
I get
- 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 alot of files inside vendor.
In order to get around this, I tried
php composer.phar update <package_name>
but that doesn't seem to work.
How can I update/install only 1 library from composer.json?
解决方案
To install "doctrine/doctrine-fixtures-bundle" with version "2.1.*" and minimum stability "@dev" use this:
composer.phar require doctrine/doctrine-fixtures-bundle:2.1.*@dev
then to update only this single package:
composer.phar update doctrine/doctrine-fixtures-bundle
这篇关于如何使用Composer更新单个库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文