Skip to content

Commit

Permalink
Merge pull request sonata-project#753 from core23/master
Browse files Browse the repository at this point in the history
Make REST Bundle optional
  • Loading branch information
rande committed Nov 23, 2015
2 parents ed8c1b8 + 71fccf1 commit 5a2f3fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions DependencyInjection/SonataMediaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ public function load(array $configs, ContainerBuilder $container)
throw new \InvalidArgumentException(sprintf('SonataMediaBundle - Invalid db driver "%s".', $config['db_driver']));
}

$loader->load(sprintf('api_form_%s.xml', $config['db_driver']));

$bundles = $container->getParameter('kernel.bundles');

if ('doctrine_orm' == $config['db_driver'] && isset($bundles['FOSRestBundle']) && isset($bundles['NelmioApiDocBundle'])) {
$loader->load('api_controllers.xml');
if (isset($bundles['FOSRestBundle']) && isset($bundles['NelmioApiDocBundle'])) {
$loader->load(sprintf('api_form_%s.xml', $config['db_driver']));

if ('doctrine_orm' == $config['db_driver']) {
$loader->load('api_controllers.xml');
}
}

if (isset($bundles['SonataNotificationBundle'])) {
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
"knplabs/gaufrette": "^0.1.6",
"imagine/imagine": "~0.3",
"kriswallsmith/buzz": "~0.6",
"friendsofsymfony/rest-bundle": "~1.1",
"jms/serializer-bundle": "~0.11|~1.0",
"nelmio/api-doc-bundle": "~2.4",
"sonata-project/intl-bundle": "~2.2"
},
"require-dev": {
Expand All @@ -40,7 +38,9 @@
"aws/aws-sdk-php": "~2.7",
"doctrine/mongodb-odm": "~1.0",
"jackalope/jackalope-doctrine-dbal": "~1.1",
"symfony/phpunit-bridge": "~2.7|~3.0"
"symfony/phpunit-bridge": "~2.7|~3.0",
"friendsofsymfony/rest-bundle": "~1.1",
"nelmio/api-doc-bundle": "~2.4"
},
"suggest": {
"sonata-project/doctrine-orm-admin-bundle": "~2.3",
Expand Down

0 comments on commit 5a2f3fa

Please sign in to comment.