New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make REST Bundle optional #753
Conversation
Can one of the admins verify this patch? |
} | ||
$bundles = $container->getParameter('kernel.bundles'); | ||
|
||
if (isset($bundles['FOSRestBundle']) && isset($bundles['NelmioApiDocBundle'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that NelmioApiDocBundle
is required to get REST working.
I copied the detection from the NewsBundle. Thought this would be the same logic |
@rande same problem like sonata-project/SonataClassificationBundle#42 |
ping @rande |
Sorry for bothering you, but can you have a quick look? @rande |
This bug is really annoying... Can you have a look @soullivaneuh as @rande seems a little busy. |
|
||
$loader->load(sprintf('api_form_%s.xml', $config['db_driver'])); | ||
if (isset($bundles['FOSRestBundle']) && isset($bundles['NelmioApiDocBundle'])) { | ||
if (!in_array(strtolower($config['db_driver']), array('doctrine_orm', 'doctrine_mongodb', 'doctrine_phpcr'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you move this code ? seems to be unrelated to bundles detections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your advice. I moved it to the origin @rande
It IS optional, as I added a check to load the API controllers only when the API bundles are available. |
ah ok, sorry you are right, i was confused :) |
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure, that require-dev
ist correct? not suggest
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are required(-dev) for the travis build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, but for the development it looks weird, so on my local machine a would have an api with docs and on prod not... 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look at the composer docs (https://getcomposer.org/doc/04-schema.md#require-dev)
The dev packages are only loaded if you have them in your root composer.json
. No require-dev
package of a child composer.json
is loaded.
Any news for this? @rande @OskarStark |
I'll let @rande decide |
Sorry for pinging you that much, but that needless dependency is really annoying... @rande |
Thank you ❤️ @rande |
As the REST bundle is not required for the this bundle, the api form and controllers definitions should only be loaded, when the bundles are used.