1
votes

I'm using the latest Symfony - 2.3

I'm trying to install SonataAdminBundles.. In tutorial is said - add this to deps file.

[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

I read there is no deps file in this version, there is composer.json for now, but when i opened composer.json i saw there is another syntax.

How should i install this bundles via composer?

Thanks

1

1 Answers

0
votes

Yes you should install dependencies with composer whenever possible. It's the recommended way.

The 2.3 version of symfony doesn't include the bin/vendors script anymore as composer provides a solid way to resolve your dependencies.

You only need to add the following to your project's require configuration in composer.json and run composer update -o afterwards to get the dependencies via composer:

"require": { 
    "...",
    "sonata-project/doctrine-orm-admin-bundle": "2.2.7",
}

sonata-project/doctrine-orm-admin-bundle has a dependency with sonata-project/admin-bundle which in turn has a dependency with sonata-project/jquery-bundle and knplabs/knp-menu-bundle ( which itself has the dependency with knplabs/knp-menu).

Composer will fetch all the needed dependencies automatically.