{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/75320812","id":75320812,"diff_hunk":"@@ -0,0 +1,73 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Symfony\\Component\\DependencyInjection;\n+\n+use Symfony\\Component\\DependencyInjection\\Exception\\BadMethodCallException;\n+use Symfony\\Component\\DependencyInjection\\Exception\\ContextElementNotFoundException;\n+\n+/**\n+ * @author Maxime Steinhausser <maxime.steinhausser@gmail.com>\n+ */\n+final class Context\n+{\n+    private $elements;\n+    private $locked = false;\n+\n+    public function __construct(array $context = array())","path":"src/Symfony/Component/DependencyInjection/Context.php","position":25,"original_position":25,"commit_id":"4dcbbc8ad81b5707755b6e22469d052b85598fb9","original_commit_id":"4dcbbc8ad81b5707755b6e22469d052b85598fb9","user":{"login":"theofidry","id":5175937,"avatar_url":"https://avatars.githubusercontent.com/u/5175937?v=3","gravatar_id":"","url":"https://api.github.com/users/theofidry","html_url":"https://github.com/theofidry","followers_url":"https://api.github.com/users/theofidry/followers","following_url":"https://api.github.com/users/theofidry/following{/other_user}","gists_url":"https://api.github.com/users/theofidry/gists{/gist_id}","starred_url":"https://api.github.com/users/theofidry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theofidry/subscriptions","organizations_url":"https://api.github.com/users/theofidry/orgs","repos_url":"https://api.github.com/users/theofidry/repos","events_url":"https://api.github.com/users/theofidry/events{/privacy}","received_events_url":"https://api.github.com/users/theofidry/received_events","type":"User","site_admin":false},"body":"maybe an example of what `$contextElements` could be as well?","created_at":"2016-08-18T14:41:51Z","updated_at":"2016-08-18T14:41:51Z","html_url":"https://github.com/symfony/symfony/pull/19646#discussion_r75320812","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/19646","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/75320812"},"html":{"href":"https://github.com/symfony/symfony/pull/19646#discussion_r75320812"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19646"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/19646","id":81614321,"html_url":"https://github.com/symfony/symfony/pull/19646","diff_url":"https://github.com/symfony/symfony/pull/19646.diff","patch_url":"https://github.com/symfony/symfony/pull/19646.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/19646","number":19646,"state":"open","locked":false,"title":"[RFC][DependencyInjection][HttpKernel] Introduce a contextualized ContainerBuilder & BootingKernel","user":{"login":"ogizanagi","id":2211145,"avatar_url":"https://avatars.githubusercontent.com/u/2211145?v=3","gravatar_id":"","url":"https://api.github.com/users/ogizanagi","html_url":"https://github.com/ogizanagi","followers_url":"https://api.github.com/users/ogizanagi/followers","following_url":"https://api.github.com/users/ogizanagi/following{/other_user}","gists_url":"https://api.github.com/users/ogizanagi/gists{/gist_id}","starred_url":"https://api.github.com/users/ogizanagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogizanagi/subscriptions","organizations_url":"https://api.github.com/users/ogizanagi/orgs","repos_url":"https://api.github.com/users/ogizanagi/repos","events_url":"https://api.github.com/users/ogizanagi/events{/privacy}","received_events_url":"https://api.github.com/users/ogizanagi/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\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 | -\r\n| License       | MIT\r\n| Doc PR        | -\r\n\r\nSupersedes #19606 by giving another more generalist approach.\r\nIt follows discussions in #19619. \r\n\r\nAs the `ContainerBuilder` should probably not behaves as a `Container` until compiled (see #19644) and as services set directly using `ContainerBuilder::set()` are vanished and cannot be got during the building phase, this POC exposes the idea of separating clearly the needs of using a service and sharing a context somehow while the container is building.\r\n\r\nApparently, it should help to fix issues like #18563 which needs to access the bundle instances during the extensions loading.\r\n\r\n- [ ] Useful ? Is the approach legit ?\r\n- [ ] Should the `Context` instance be locked before or after extensions are loaded ?  \r\nI.e: Should we allow extensions to mutate the context and consider it \"safe to use\" only in compiler passes, or should we only allow to initially set the context from the `KernelInterface::getContainerBuilder()` ?\r\n- [ ] If the answer to the previous question is \"Do not allow extensions to mutate the context\", what about simply making the `Context` class immutable (Thus cannot be changed after creating the `ContainerBuilder` instance) ? No more `lock`, no more `set`.  \r\n- [ ] Add tests if approved.\r\n\r\n--- \r\nAnother solution only focused on the need to access the kernel & bundles instances from an extension could be to create a `KernelAwareInterface`. If an extension implements this interface, then we inject a `BootingKernel` instance.","created_at":"2016-08-17T09:54:22Z","updated_at":"2016-08-18T14:41:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d898845d23790eb39619327aff1e160f406ea4b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/19646/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/19646/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/19646/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/4dcbbc8ad81b5707755b6e22469d052b85598fb9","head":{"label":"ogizanagi:contextualized_container","ref":"contextualized_container","sha":"4dcbbc8ad81b5707755b6e22469d052b85598fb9","user":{"login":"ogizanagi","id":2211145,"avatar_url":"https://avatars.githubusercontent.com/u/2211145?v=3","gravatar_id":"","url":"https://api.github.com/users/ogizanagi","html_url":"https://github.com/ogizanagi","followers_url":"https://api.github.com/users/ogizanagi/followers","following_url":"https://api.github.com/users/ogizanagi/following{/other_user}","gists_url":"https://api.github.com/users/ogizanagi/gists{/gist_id}","starred_url":"https://api.github.com/users/ogizanagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogizanagi/subscriptions","organizations_url":"https://api.github.com/users/ogizanagi/orgs","repos_url":"https://api.github.com/users/ogizanagi/repos","events_url":"https://api.github.com/users/ogizanagi/events{/privacy}","received_events_url":"https://api.github.com/users/ogizanagi/received_events","type":"User","site_admin":false},"repo":{"id":13498527,"name":"symfony","full_name":"ogizanagi/symfony","owner":{"login":"ogizanagi","id":2211145,"avatar_url":"https://avatars.githubusercontent.com/u/2211145?v=3","gravatar_id":"","url":"https://api.github.com/users/ogizanagi","html_url":"https://github.com/ogizanagi","followers_url":"https://api.github.com/users/ogizanagi/followers","following_url":"https://api.github.com/users/ogizanagi/following{/other_user}","gists_url":"https://api.github.com/users/ogizanagi/gists{/gist_id}","starred_url":"https://api.github.com/users/ogizanagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogizanagi/subscriptions","organizations_url":"https://api.github.com/users/ogizanagi/orgs","repos_url":"https://api.github.com/users/ogizanagi/repos","events_url":"https://api.github.com/users/ogizanagi/events{/privacy}","received_events_url":"https://api.github.com/users/ogizanagi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ogizanagi/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/ogizanagi/symfony","forks_url":"https://api.github.com/repos/ogizanagi/symfony/forks","keys_url":"https://api.github.com/repos/ogizanagi/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ogizanagi/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ogizanagi/symfony/teams","hooks_url":"https://api.github.com/repos/ogizanagi/symfony/hooks","issue_events_url":"https://api.github.com/repos/ogizanagi/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/ogizanagi/symfony/events","assignees_url":"https://api.github.com/repos/ogizanagi/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/ogizanagi/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/ogizanagi/symfony/tags","blobs_url":"https://api.github.com/repos/ogizanagi/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ogizanagi/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ogizanagi/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/ogizanagi/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ogizanagi/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/ogizanagi/symfony/languages","stargazers_url":"https://api.github.com/repos/ogizanagi/symfony/stargazers","contributors_url":"https://api.github.com/repos/ogizanagi/symfony/contributors","subscribers_url":"https://api.github.com/repos/ogizanagi/symfony/subscribers","subscription_url":"https://api.github.com/repos/ogizanagi/symfony/subscription","commits_url":"https://api.github.com/repos/ogizanagi/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/ogizanagi/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/ogizanagi/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/ogizanagi/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/ogizanagi/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/ogizanagi/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ogizanagi/symfony/merges","archive_url":"https://api.github.com/repos/ogizanagi/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ogizanagi/symfony/downloads","issues_url":"https://api.github.com/repos/ogizanagi/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/ogizanagi/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/ogizanagi/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/ogizanagi/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ogizanagi/symfony/labels{/name}","releases_url":"https://api.github.com/repos/ogizanagi/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/ogizanagi/symfony/deployments","created_at":"2013-10-11T12:37:26Z","updated_at":"2016-07-12T20:36:06Z","pushed_at":"2016-08-18T11:53:00Z","git_url":"git://github.com/ogizanagi/symfony.git","ssh_url":"git@github.com:ogizanagi/symfony.git","clone_url":"https://github.com/ogizanagi/symfony.git","svn_url":"https://github.com/ogizanagi/symfony","homepage":"symfony.com","size":71265,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"885c388917c42ac11c519adffb5cc5e080583d8a","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-08-18T14:17:24Z","pushed_at":"2016-08-18T14:25:35Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":134144,"stargazers_count":12794,"watchers_count":12794,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4977,"mirror_url":null,"open_issues_count":749,"forks":4977,"open_issues":749,"watchers":12794,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19646"},"html":{"href":"https://github.com/symfony/symfony/pull/19646"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/19646"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/19646/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19646/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19646/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/4dcbbc8ad81b5707755b6e22469d052b85598fb9"}}}}
{"actor":{"display_login":"theofidry"}}