{"action":"created","issue":{"url":"https://api.github.com/repos/contao/core-bundle/issues/192","labels_url":"https://api.github.com/repos/contao/core-bundle/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/contao/core-bundle/issues/192/comments","events_url":"https://api.github.com/repos/contao/core-bundle/issues/192/events","html_url":"https://github.com/contao/core-bundle/issues/192","id":68039253,"number":192,"title":"[RFC] Split up the InitializeSystemListener","user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","gravatar_id":"","url":"https://api.github.com/users/Toflar","html_url":"https://github.com/Toflar","followers_url":"https://api.github.com/users/Toflar/followers","following_url":"https://api.github.com/users/Toflar/following{/other_user}","gists_url":"https://api.github.com/users/Toflar/gists{/gist_id}","starred_url":"https://api.github.com/users/Toflar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toflar/subscriptions","organizations_url":"https://api.github.com/users/Toflar/orgs","repos_url":"https://api.github.com/users/Toflar/repos","events_url":"https://api.github.com/users/Toflar/events{/privacy}","received_events_url":"https://api.github.com/users/Toflar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-13T08:22:51Z","updated_at":"2015-04-13T09:07:30Z","closed_at":null,"body":"We currently have the problem that our `InitializeSystemListener ` is pretty complex and does way too much to be tested thoroughly. For instance, it extends our `ScopeAwareListener` which means that whatever you test, you need to set a container to it even if that specific part of the listener you want to test is not related to any container at all.\r\n\r\nAlso related to https://github.com/contao/core-bundle/issues/175 I think we should really go about this again. I feel like the `InitializeSystemListener` is correctly placed but the components are wrong.\r\n\r\nMy approach (simplified):\r\n\r\n```php\r\nclass InitializeSystemListener\r\n{\r\n    private $framework;\r\n\r\n    public function __construct(ContaoFramework $framework)\r\n    {\r\n        $this->framework = $framework;\r\n   }\r\n\r\n    public function onKernelRequest(GetResponseEvent $event)\r\n    {\r\n        $this->framework->boot();\r\n    }\r\n}\r\n```\r\n\r\n```php\r\nclass ContaoFramework\r\n{\r\n    public function boot()\r\n    {\r\n        $bootEvent = new BootEvent();\r\n        $this->eventDispatcher->dispatch(ContaoEvents::BOOT_FRAMEWORK, $bootEvent);\r\n    }\r\n}\r\n```\r\n\r\nThis provides the possibility to have all our other responsibilities such as\r\n\r\n* Setting constants\r\n* Setting ini values\r\n* Setting default language\r\n* Error handling\r\n* Validating the installation\r\n* etc.\r\n\r\nin their very own listeners listening to `ContaoEvents::BOOT_FRAMEWORK` and they only get the things injected they need :-)\r\n\r\n* CoreBundle\r\n    * Listener\r\n        * BootFramework\r\n            * SetConstantsListener.php\r\n            * ValidateInstallationListener.php\r\n            * etc.\r\n\r\n\r\nRFC ;-)"},"comment":{"url":"https://api.github.com/repos/contao/core-bundle/issues/comments/92280284","html_url":"https://github.com/contao/core-bundle/issues/192#issuecomment-92280284","issue_url":"https://api.github.com/repos/contao/core-bundle/issues/192","id":92280284,"user":{"login":"leofeyer","id":1192057,"avatar_url":"https://avatars.githubusercontent.com/u/1192057?v=3","gravatar_id":"","url":"https://api.github.com/users/leofeyer","html_url":"https://github.com/leofeyer","followers_url":"https://api.github.com/users/leofeyer/followers","following_url":"https://api.github.com/users/leofeyer/following{/other_user}","gists_url":"https://api.github.com/users/leofeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/leofeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leofeyer/subscriptions","organizations_url":"https://api.github.com/users/leofeyer/orgs","repos_url":"https://api.github.com/users/leofeyer/repos","events_url":"https://api.github.com/users/leofeyer/events{/privacy}","received_events_url":"https://api.github.com/users/leofeyer/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T09:07:30Z","updated_at":"2015-04-13T09:07:30Z","body":"Reminds me a lot of #60, in which you guys have voted against changing the listener :)"}}