简体   繁体   中英

Remove SonataPageBundle or Install a fresh Symfony2 with SonataAdmin project

I downloaded and setup an Sonata's Sonata-Sandbox Bundle for Symfony2. I'm using Symfony 2.2.2. It's a good package and contains mostly used packages installed.

After installation I decided not to use SonataPageBundle that's included in package because it overrides all my Bundle's but unable to remove it.

I tried to remove it from composer.json and tried a php composer.phar update but no luck, update is always failing because of the dependency other libraries.

Actually, I need SonataAdminBundle with Media library on any version of Symfony 2.x. I found other solutions to install Symfony 2 + SonataAdminBundle + etc but they are also failing on different version support in composer.json and could't make a successful installation manually.

I'm on Mac 10.8 and BitNapi MAMP Stack 5.4.15-0 with PHP 5.3

Are there any better ways to install these extensions to Symfony 2?

Yes, you can use composer to install only the Sonata bundles you need. Here's mine, which is about as short as it gets for Sonata using Doctrine:

"require": {
    "sonata-project/admin-bundle": "dev-master",
    "sonata-project/doctrine-orm-admin-bundle": "dev-master",
    "sonata-project/user-bundle": "dev-master",
    "sonata-project/media-bundle": "dev-master"
}

If you haven't actually started coding anything, you might want to start a new project because removing PageBundle is slightly tedious and reinstalling using this guide is simple and basically three simple steps:

Install composer:

curl -s https://getcomposer.org/installer | php

Download Symfony2:

php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.3.0

Then you can add the bundles you need in composer.json and run

php composer.phar update

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM