I need to install only 1 package for my SF2 distribution (DoctrineFixtures).
我需要為我的SF2發行版安裝一個軟件包(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 a lot 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 one library from composer.json?
但這似乎不起作用。如何從composer.json更新/安裝一個庫?
331
To install doctrine/doctrine-fixtures-bundle
with version 2.1.*
and minimum stability @dev
use this:
要安裝doctrine / doctrine-fixtures-bundle 2.1版。*和最小穩定性@dev,請使用:
composer.phar require doctrine/doctrine-fixtures-bundle:2.1.*@dev
then to update only this single package:
然后只更新這個包:
composer.phar update doctrine/doctrine-fixtures-bundle
114
If you just want to update a few packages and not all, you can list them as such:
如果您只想更新一些軟件包而不是所有軟件包,可以將它們列為:
php composer.phar update vendor/package:2.* vendor/package2:dev-master
You can also use wildcards to update a bunch of packages at once:
您還可以使用通配符一次更新一堆包:
php composer.phar update vendor/*
source
when available.dist
when available.php
, hhvm
, lib-*
and ext-*
requirements and force the installation even if the local machine does not fulfill these. See also the platform
config option.require-dev
(this is the default behavior).require-dev
. The autoloader generation skips the autoload-dev
rules.--prefer-stable
.4
You can basically do following one to install new package as well.
您基本上可以執行以下操作來安裝新軟件包。
php composer.phar require
then terminal will ask you to enter the name of the package for searching.
然后終端會要求您輸入要搜索的包的名稱。
$ Search for a package []: //Your package name here
Then terminal will ask the version of the package (If you would like to have the latest version just leave it blank)
然后終端會詢問包的版本(如果您想要最新版本,請將其留空)
$ Enter the version constraint to require (or leave blank to use the latest version) []: //your version number here
Then you just press the return key. Terminal will ask for another package, if you dont want to install another one just press the return key and you will be done.
然后你只需按返回鍵。終端會要求另一個包裹,如果您不想再安裝另一個包裹,只需按回車鍵即可完成。
2
To ensure that composer update one package already installed to the last version within the version constraints you've set in composer.json remove the package from vendor and then execute :
要確保作曲家將已安裝的一個軟件包更新到您在composer.json中設置的版本約束中的最后一個版本,請從供應商中刪除該軟件包,然后執行:
php composer.phar update vendor/package
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2013/05/24/724e86237ccd86e0fdb3388ac5f41dc4.html。