{"action":"created","issue":{"url":"https://api.github.com/repos/contao/core-bundle/issues/1383","repository_url":"https://api.github.com/repos/contao/core-bundle","labels_url":"https://api.github.com/repos/contao/core-bundle/issues/1383/labels{/name}","comments_url":"https://api.github.com/repos/contao/core-bundle/issues/1383/comments","events_url":"https://api.github.com/repos/contao/core-bundle/issues/1383/events","html_url":"https://github.com/contao/core-bundle/pull/1383","id":298347106,"number":1383,"title":"[RFC] Make all services public that we are retrieving directly from the container","user":{"login":"sheeep","id":607530,"avatar_url":"https://avatars0.githubusercontent.com/u/607530?v=4","gravatar_id":"","url":"https://api.github.com/users/sheeep","html_url":"https://github.com/sheeep","followers_url":"https://api.github.com/users/sheeep/followers","following_url":"https://api.github.com/users/sheeep/following{/other_user}","gists_url":"https://api.github.com/users/sheeep/gists{/gist_id}","starred_url":"https://api.github.com/users/sheeep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheeep/subscriptions","organizations_url":"https://api.github.com/users/sheeep/orgs","repos_url":"https://api.github.com/users/sheeep/repos","events_url":"https://api.github.com/users/sheeep/events{/privacy}","received_events_url":"https://api.github.com/users/sheeep/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-19T17:07:32Z","updated_at":"2018-02-19T20:44:12Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/contao/core-bundle/pulls/1383","html_url":"https://github.com/contao/core-bundle/pull/1383","diff_url":"https://github.com/contao/core-bundle/pull/1383.diff","patch_url":"https://github.com/contao/core-bundle/pull/1383.patch"},"body":"I searched the Contao source code for instances of `getContainer()->get('...');` occurrences, filtered out `contao` prefixed services and \"uniquified\" the resulting array.\r\n\r\n```\r\nassets.packages\r\ndatabase_connection\r\ndoctrine.dbal.default_connection\r\nevent_dispatcher\r\nfilesystem\r\nfragment.handler\r\nlexik_maintenance.driver.factory\r\nmonolog.logger.contao\r\nrequest_stack\r\nrouter\r\nsecurity.authentication_utils\r\nsecurity.authorization_checker\r\nsecurity.firewall.map\r\nsecurity.logout_url_generator\r\nsecurity.token_storage\r\nsession\r\nswiftmailer.mailer\r\ntranslator\r\n```\r\n\r\nAfter intersecting this array to the one found in this ticket (future public services) [this ticket](https://github.com/symfony/symfony/pull/24104), we end up with:\r\n\r\n```\r\nassets.packages\r\ndatabase_connection\r\ndoctrine.dbal.default_connection\r\nfragment.handler\r\nlexik_maintenance.driver.factory\r\nmonolog.logger.contao\r\nsecurity.firewall.map\r\nsecurity.logout_url_generator\r\nswiftmailer.mailer\r\n```\r\n\r\nI added those to our `MakeServicesPublicPass` and made sure it will also find aliases instead of definitions only.\r\n\r\nUnfortunately I'm not sure if I really caught all direct service references. Do you have any other ideas?"},"comment":{"url":"https://api.github.com/repos/contao/core-bundle/issues/comments/366798508","html_url":"https://github.com/contao/core-bundle/pull/1383#issuecomment-366798508","issue_url":"https://api.github.com/repos/contao/core-bundle/issues/1383","id":366798508,"user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars2.githubusercontent.com/u/481937?v=4","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},"created_at":"2018-02-19T20:44:12Z","updated_at":"2018-02-19T20:44:12Z","author_association":"MEMBER","body":"Shouldn't we make that pass a bit more generic? We'll have more and probably also others need that when they want to access a service from within the legacy code.\r\nWhat about\r\n\r\n```yaml\r\nservice_name_that_needs_to_be_accessible:\r\n   class: foobar\r\n   tags:\r\n      - { name: contao.allow_legacy_container_access }\r\n```\r\n\r\nwhich will basically ensure they are all `public`? "}}
{"actor":{"display_login":"Toflar"}}