{"action":"created","issue":{"url":"https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/issues/260","labels_url":"https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/issues/260/comments","events_url":"https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/issues/260/events","html_url":"https://github.com/sensiolabs/SensioGeneratorBundle/pull/260","id":26174473,"number":260,"title":"Support for adding enabling multiple bundles via KernelManipulator","user":{"login":"solocommand","id":1778222,"avatar_url":"https://avatars.githubusercontent.com/u/1778222?v=3","gravatar_id":"","url":"https://api.github.com/users/solocommand","html_url":"https://github.com/solocommand","followers_url":"https://api.github.com/users/solocommand/followers","following_url":"https://api.github.com/users/solocommand/following{/other_user}","gists_url":"https://api.github.com/users/solocommand/gists{/gist_id}","starred_url":"https://api.github.com/users/solocommand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solocommand/subscriptions","organizations_url":"https://api.github.com/users/solocommand/orgs","repos_url":"https://api.github.com/users/solocommand/repos","events_url":"https://api.github.com/users/solocommand/events{/privacy}","received_events_url":"https://api.github.com/users/solocommand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-01-23T15:37:36Z","updated_at":"2015-08-10T08:33:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/pulls/260","html_url":"https://github.com/sensiolabs/SensioGeneratorBundle/pull/260","diff_url":"https://github.com/sensiolabs/SensioGeneratorBundle/pull/260.diff","patch_url":"https://github.com/sensiolabs/SensioGeneratorBundle/pull/260.patch"},"body":"This PR adds support for adding multiple bundles to the AppKernel via the KernelManipulator.\r\n\r\nDue to PHP only allowing classes to be defined once, if KernelManipulator->addBundle() is used in a loop it will eventually stop adding bundles to the AppKernel. This is because the AppKernel is read using file() before each write, getting the latest changes to the AppKernel, but the ReflectionMethod getStartLine and getEndLine methods do not reflect the latest changes. The ReflectionObject cannot be updated to a new version of the AppKernel at runtime, as the class cannot be redeclared.\r\n\r\nAdded an addBundles method to support adding an array of bundle names, and refactored addBundle/addBundles methods to prevent duplication of code.\r\n\r\nSorry about the diff, not nearly as clean as I was hoping it would be."},"comment":{"url":"https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/issues/comments/129364847","html_url":"https://github.com/sensiolabs/SensioGeneratorBundle/pull/260#issuecomment-129364847","issue_url":"https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/issues/260","id":129364847,"user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T08:33:03Z","updated_at":"2015-08-10T08:33:03Z","body":"@solocommand I know that my feeback is VERY late ... but I'd like to ask you about the use case for this feature. The generation commands only generate one bundle at a time. And if some day we add a command to install bundles, we'll only allow to install one bundle at a time. Why/When do you want to enable several bundles at a time?"}}