{"action":"created","issue":{"url":"https://api.github.com/repos/dunglas/DunglasActionBundle/issues/60","repository_url":"https://api.github.com/repos/dunglas/DunglasActionBundle","labels_url":"https://api.github.com/repos/dunglas/DunglasActionBundle/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/dunglas/DunglasActionBundle/issues/60/comments","events_url":"https://api.github.com/repos/dunglas/DunglasActionBundle/issues/60/events","html_url":"https://github.com/dunglas/DunglasActionBundle/issues/60","id":186159952,"number":60,"title":"Directories Injection","user":{"login":"Spomky","id":1091072,"avatar_url":"https://avatars.githubusercontent.com/u/1091072?v=3","gravatar_id":"","url":"https://api.github.com/users/Spomky","html_url":"https://github.com/Spomky","followers_url":"https://api.github.com/users/Spomky/followers","following_url":"https://api.github.com/users/Spomky/following{/other_user}","gists_url":"https://api.github.com/users/Spomky/gists{/gist_id}","starred_url":"https://api.github.com/users/Spomky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spomky/subscriptions","organizations_url":"https://api.github.com/users/Spomky/orgs","repos_url":"https://api.github.com/users/Spomky/repos","events_url":"https://api.github.com/users/Spomky/events{/privacy}","received_events_url":"https://api.github.com/users/Spomky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-30T20:14:29Z","updated_at":"2016-11-02T18:56:40Z","closed_at":null,"body":"Hi,\n\nI have a little DX issue with that bundle.\nMy project uses the excellent [`matthiasnoback/symfony-bundle-plugins)`](https://github.com/matthiasnoback/symfony-bundle-plugins) and actions are stored in each plugin folders.\n\nDevelopers  can modify the `dunglas_action.directories` configuration value to add folders containing classes.\nHoever, I think this step could be avoided by adding a compiler class that will add the concerned folders without any configuration modification. Something that look like the following class:\n\n``` php\n<?php\n\nnamespace AppBundle\\DependencyInjection\\Compiler;\n\nuse Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface;\n\nfinal class DirectoryModificatorCompilerPass implements CompilerPassInterface\n{\n    /**\n     * {@inheritdoc}\n     */\n    public function process(ContainerBuilder $container)\n    {\n        if (!$container->hasDefinition('dunglas_action.directory_manager')) {\n            return;\n        }\n\n        $definition = $container->getDefinition('dunglas_action.directory_manager');\n        $patterns = [\n            '/my/custom/directory/Actions',\n            '/another/directory/Command',\n        ];\n        $definition->addMethodCall('addPatterns', [$patterns]);\n    }\n}\n```\n\nDo you think it is possible to provide a service (I named it `dunglas_action.directory_manager` in my example) that will provide a `addPatterns(array $patterns)` (or `addPattern(string $pattern)`) method?\n\nFrom my point of view it will requires to move all the logic in the [DunglasActionExtension.php](https://github.com/dunglas/DunglasActionBundle/blob/master/DependencyInjection/DunglasActionExtension.php) to that dedicated service.\n"},"comment":{"url":"https://api.github.com/repos/dunglas/DunglasActionBundle/issues/comments/257964931","html_url":"https://github.com/dunglas/DunglasActionBundle/issues/60#issuecomment-257964931","issue_url":"https://api.github.com/repos/dunglas/DunglasActionBundle/issues/60","id":257964931,"user":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T18:56:40Z","updated_at":"2016-11-02T18:56:40Z","body":"That's not possible to have a service as this bundle works at compile time. However you can dynamically update this bundle configuration using an extension (with `PrependExtensionInterdace`)."}}
{"actor":{"display_login":"Ener-Getick"}}