symfony2.1 bundle version confusion, for symfony and sonata admin / knp menu bundle

走远了吗. 提交于 2019-12-05 06:05:49

1a) Is this right? Or is there another solution? I mean to use bundles which are stable and not in dev mode

Symfony21 will standard choose the best version for you. You can see these versions in the composer.json file of the symfony/framework-standard-edition package (symfony/symfony-standard on github).

As you can see it uses the 2.1.* versions and not the dev-master versions, but because the latest version of the package begins with 2.1 it will load the dev-master. Later, with symfony2.2 it shouldn't use the dev-master, but the latest 2.1 version of the package.

If you want a static version you can just replace the * with the subversion you want, but I don't recommend this because you don't get the bug fixes.

1b) So I should do a composer update in regular intervals while developing my app, to merge new bugfixes, etc?

Yes, it is good to update your dependencies from time to time. For instance if you think you spot a bug or if you push it in production.

2a) Is there a difference if there is a leading v before the version number?

As we can read in the packagist documentation (under Managing package versions) there is no difference. You can use them both and if you use 2.1.4 it will look for a 2.1.4 version or v2.1.4.

2b) Which version will be used of these four, when the dependency is 1.1.* ?

The latest 1.1 subversion. For instance if you foobar package has these versions: 1.1.1, 1.1.2 .. 1.1.6. And you require 1.1.* the latest (1.1.6) will be installed.

3) but when I repeat the step the error was gone. Is this normal?

It looks like the CLI can't access the file, you maybe opened it in a program. When you tried it the second time it had access.

4) Why is the KnpMenu install construction outdated and why there is only a master branch on github and nothing for the versions which exist on http://packagist.org?

First question: I don't know why the documentation is outdated. You should go into the vendor/composer/autoload_namespaces.php file and put the namespaces there, then it should work. Or, the better option, add these namespaces to the require setting in the composer.json file. See the composer autoload docs for more information.

Second question: It uses the tags on github too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!