手动更新Symfony2 deps文件以获取Doctrine 2.2? [英] Manually updating Symfony2 deps file to get Doctrine 2.2?
问题描述
可以手动更新 deps
文件以获取最新版本的 Doctrine 2.2 ?我想使用新的 Paginator 组件。所以基本上我正在考虑用以下方式调整 deps
:
[doctrine-共同]
git = http://github.com/doctrine/common.git
version = 2.2.1
[doctrine-dbal]
git = http ://github.com/doctrine/dbal.git
version = 2.2.1
[doctrine]
git = http://github.com/doctrine/doctrine2。 git
version = 2.2.1
删除 deps.lock
并做:
php bin / vendor更新
/ pre>
你认为会有效吗?
编辑:该文件将如下所示: http://pastebin.com/FEDMNhii
解决方案在我看来,所有的工作由 gilden 是不必要的,过于谨慎。当然,您可以手动更新您的
deps
文件。我正在Symfony 2.0.11上运行Doctrine\Common(2.2.1),Doctrine\DBAL(2.2.1)和Doctrine(2.2.1),没有问题。
不需要担心的库(通常),这是 bundle 使用需要特定版本的库的 。例如,Symfony2没有直接依赖任何版本的Doctrine - 但是 DoctrineBundle
在升级包/库之前,通常很好的查看他们对 Packagist.org 。搜索要升级的软件包,并查看它们定义的所需依赖关系。 注意: Symfony 2.1将不再需要这一点,因为它将使用作曲家来管理供应商图书馆。
尽管如此,除非你尝试,否则你永远不会知道有什么可以用于你的安装。当然,不要做任何愚蠢的事情 - 但是没有理由害怕通过更新供应商库来破解事情。将您的代码存储在Git中,您可以轻松地恢复您的更改。请参阅:如何在Git中创建和存储Symfony2项目
此外,当指定
version =#。#。#
code> deps - 即使你没有一个deps.lock
文件,你总是会得到相同的提交哈希,因为您在存储库中指定Git标签。
某些软件包,而不是提供版本号,将提供各种分支,用于管理与多个Symfony版本的兼容性。因此,您可能会看到类似
version = origin / 2.0
的内容,这意味着供应商脚本将检出名为2.0 $ c $的分支上的最新提交c>存储库。维护者最有可能试图让分支始终与Symfony 2.0.x兼容。
Is possible to manually update
deps
file to get the latest version of Doctrine 2.2? I'd like to use the new Paginator component. So basically i was thinking to tweakdeps
with:[doctrine-common] git=http://github.com/doctrine/common.git version=2.2.1 [doctrine-dbal] git=http://github.com/doctrine/dbal.git version=2.2.1 [doctrine] git=http://github.com/doctrine/doctrine2.git version=2.2.1
Remove
deps.lock
and do:php bin/vendors update
Do you think that will work?
EDIT: the file would look like this: http://pastebin.com/FEDMNhii
解决方案In my opinion, all of the work suggested by gilden is unnecessary and over-cautious. Of course you can manually update your
deps
file with whatever you want. I'm currently running Doctrine\Common (2.2.1), Doctrine\DBAL (2.2.1), and Doctrine (2.2.1) on Symfony 2.0.11 without issues.It isn't the libraries that you need to worry about (usually), it is the bundles that utilize the libraries that require specific version(s). For example, Symfony2 has no direct dependency on any version of Doctrine -- but the DoctrineBundle does.
Before upgrading a bundle/library, it is usually good to check out their required dependencies on Packagist.org. Search for the package you want to upgrade and see what required dependencies they define. Note: This won't be required on Symfony 2.1 since it will use Composer to manage vendor libraries.
Although, you'll never know if something works with your install or not unless you try it. Of course, don't do anything stupid - but there is no reason to be scared of breaking things by updating vendor libraries. Store your code in Git and you can easily revert your changes. See: How to create and store a Symfony2 project in Git
Also, when specifying
version=#.#.#
indeps
- even if you do not have adeps.lock
file at all, you will always get the same commit hash because you are specifying the Git tag on the repository.Some bundles, rather than providing version numbers, will offer various branches for managing compatibility with multiple Symfony versions. So you may see something like
version=origin/2.0
which means the vendors script will checkout the latest commit on the branch named2.0
of the repository. The maintainer will most likely try to keep that branch always compatible with Symfony 2.0.x.这篇关于手动更新Symfony2 deps文件以获取Doctrine 2.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!