我正在使用最新的Symfony - 2.3
我在试着安装SonataAdminBundles。在教程中说-将此添加到deps文件中。
[SonataAdminBundle]
git=http://github.com/sonata-project/SonataAdminBundle.git
target=/bundles/Sonata/AdminBundle
[SonataDoctrineORMAdminBundle]
git=http://github.com/sonata-project/SonataDoctrineORMAdminBundle.git
target=/bundles/Sonata/DoctrineORMAdminBundle
[SonatajQueryBundle]
git=http://github.com/sonata-project/SonatajQueryBundle.git
target=/bundles/Sonata/jQueryBundle
[KnpMenuBundle]
git=https://github.com/KnpLabs/KnpMenuBundle.git
target=/bundles/Knp/Bundle/MenuBundle
[KnpMenu]
git=https://github.com/KnpLabs/KnpMenu.git
target=/knp/menu我读到这个版本中没有deps文件,现在是composer.json,但是当我打开composer.json时,我看到了另一个语法。
我应该如何通过composer安装这个包?
谢谢
发布于 2013-10-30 10:10:15
是的,只要有可能,就应该使用composer安装依赖项。这是推荐的方法。
symfony的2.3版本不再包含bin/vendors脚本,因为composer提供了解决依赖关系的可靠方法。
您只需要将以下内容添加到项目的require配置中( composer.json中),然后运行composer update -o才能通过composer获得依赖关系:
"require": {
"...",
"sonata-project/doctrine-orm-admin-bundle": "2.2.7",
}sonata-project/doctrine-orm-admin-bundle与sonata-project/admin-bundle具有依赖关系,而后者又依赖于sonata-project/jquery-bundle和knplabs/knp-menu-bundle (后者本身具有与knplabs/knp-menu的依赖关系)。
Composer将自动获取所有所需的依赖项。
https://stackoverflow.com/questions/19679251
复制相似问题