Manually updating Symfony2 deps file to get Doctrine 2.2?

前端 未结 2 1415
走了就别回头了
走了就别回头了 2021-02-06 07:51

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 wa

2条回答
  •  名媛妹妹
    2021-02-06 08:57

    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=#.#.# in deps - even if you do not have a deps.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 named 2.0 of the repository. The maintainer will most likely try to keep that branch always compatible with Symfony 2.0.x.

提交回复
热议问题