{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/15011","labels_url":"https://api.github.com/repos/symfony/symfony/issues/15011/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15011/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/15011/events","html_url":"https://github.com/symfony/symfony/pull/15011","id":88838076,"number":15011,"title":"[2.8][HttpKernel] Added support for registering Bundle dependencies","user":{"login":"andrerom","id":289757,"avatar_url":"https://avatars.githubusercontent.com/u/289757?v=3","gravatar_id":"","url":"https://api.github.com/users/andrerom","html_url":"https://github.com/andrerom","followers_url":"https://api.github.com/users/andrerom/followers","following_url":"https://api.github.com/users/andrerom/following{/other_user}","gists_url":"https://api.github.com/users/andrerom/gists{/gist_id}","starred_url":"https://api.github.com/users/andrerom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrerom/subscriptions","organizations_url":"https://api.github.com/users/andrerom/orgs","repos_url":"https://api.github.com/users/andrerom/repos","events_url":"https://api.github.com/users/andrerom/events{/privacy}","received_events_url":"https://api.github.com/users/andrerom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-06-16T20:54:21Z","updated_at":"2015-09-07T17:58:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/15011","html_url":"https://github.com/symfony/symfony/pull/15011","diff_url":"https://github.com/symfony/symfony/pull/15011.diff","patch_url":"https://github.com/symfony/symfony/pull/15011.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #13505\r\n| License       | MIT\r\n| Doc PR        | https://github.com/symfony/symfony-docs/pull/5610\r\n\r\nAs there are ongoing discussions in both in eZ and [Symfony CMF](https://github.com/symfony-cmf/symfony-cmf/issues/216) on this topic *(and in Sylius)*, agreed with @lsmith77 to open PR to discuss this potential light weight native approach. Alternative if native feature is not wanted is [OroPlatform](https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/DistributionBundle/OroKernel.php), a custom, still somewhat project specific and heavier approach involving bundles.yml files and caching needs.\r\n\r\n## What?\r\nAdds possibility for a Bundle to specify other bundles it depends on. This allows root/meta projects to not have to specify dependencies of dependencies, and no need for user to perform manual upgrade work in Kernel file when they change.\r\n\r\n*This could potentially allow \"distribution bundles\" for larger solutions like Sylius, CMF and eZ to be more easily installed in same Symfony installation, assuming there is no package or other conflicts.*\r\n\r\nA dependency implies two things for the Kernel:\r\n- make sure it is loaded, unless dependency is marked as *optional*\r\n- order it before \"current\" bundle\r\n\r\nThe last point is because we assume a dependency is something we might extend so we *always* load it before \"self\".\r\n\r\n## How\r\nA optional interface is added that bundles can implement, while the method could have been added\r\nto the main interface like getParent(), this approach allows the code to check using instanceof,\r\nkeeps full BC, and allows a clear contract on use of this feature.\r\n\r\nThe approach further explicitly avoids giving bundle writers any control over priority of load ordering other\r\nthen \"before self\", as otherwise it would 1. potential lead to conflicts, and 2. complicate the implementation.\r\n\r\nFor further info on the new function and why it returns FQN class names, see BundleDependenciesInterface.\r\n\r\n## Todo\r\n- [x] CS fixes\r\n- [x] Testing, incl recursion testing and fixes in implementation for this\r\n- [x] Update Doc when discussion with core team have been made on selecting approach for dealing with optional dependencies *(the approach suggested here is to handle it in doc, see BundleDependenciesInterface)*\r\n\r\nFor earlier discussions see #13945 *(was targeted at 2.7)*"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/138349782","html_url":"https://github.com/symfony/symfony/pull/15011#issuecomment-138349782","issue_url":"https://api.github.com/repos/symfony/symfony/issues/15011","id":138349782,"user":{"login":"JHGitty","id":5406438,"avatar_url":"https://avatars.githubusercontent.com/u/5406438?v=3","gravatar_id":"","url":"https://api.github.com/users/JHGitty","html_url":"https://github.com/JHGitty","followers_url":"https://api.github.com/users/JHGitty/followers","following_url":"https://api.github.com/users/JHGitty/following{/other_user}","gists_url":"https://api.github.com/users/JHGitty/gists{/gist_id}","starred_url":"https://api.github.com/users/JHGitty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JHGitty/subscriptions","organizations_url":"https://api.github.com/users/JHGitty/orgs","repos_url":"https://api.github.com/users/JHGitty/repos","events_url":"https://api.github.com/users/JHGitty/events{/privacy}","received_events_url":"https://api.github.com/users/JHGitty/received_events","type":"User","site_admin":false},"created_at":"2015-09-07T17:58:09Z","updated_at":"2015-09-07T17:58:09Z","body":"Status: Needs Review"}}