{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/40645648","id":40645648,"diff_hunk":"@@ -0,0 +1,71 @@\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\\Bundle\\FrameworkBundle\\Kernel;\n+\n+use Symfony\\Bundle\\FrameworkBundle\\Routing\\RouteCollectionBuilder;\n+use Symfony\\Component\\Config\\Loader\\LoaderInterface;\n+use Symfony\\Component\\DependencyInjection\\ContainerBuilder;\n+use Symfony\\Component\\HttpKernel\\MicroKernel as BaseMicroKernel;\n+use Symfony\\Component\\Routing\\Loader\\RouteLoaderInterface;\n+\n+/**\n+ * A kernel that adds some functionality that depends on FrameworkBundle.\n+ *\n+ * @author Ryan Weaver <ryan@knpuniversity.com>\n+ */\n+abstract class MicroKernel extends BaseMicroKernel implements RouteLoaderInterface\n+{\n+    /**\n+     * Add or import routes into your application.\n+     *\n+     *     $routes->import('config/routing.yml');\n+     *     $routes->add('/admin', 'AppBundle:Admin:dashboard', 'admin_dashboard');\n+     *\n+     * @param RouteCollectionBuilder $routes\n+     */\n+    abstract protected function configureRoutes(RouteCollectionBuilder $routes);\n+\n+    /**\n+     * Creates a RouteCollectionBuilder for convenience and calls configureRoutes.\n+     *\n+     * @param LoaderInterface $loader\n+     *\n+     * @return \\Symfony\\Component\\Routing\\RouteCollection\n+     */\n+    public function getRouteCollection(LoaderInterface $loader)\n+    {\n+        $routes = new RouteCollectionBuilder($loader);\n+\n+        $this->configureRoutes($routes);\n+\n+        return $routes->build();\n+    }\n+\n+    /**\n+     * Overridden to make the routing resource be the kernel.\n+     *\n+     * @param LoaderInterface $loader\n+     */\n+    public function registerContainerConfiguration(LoaderInterface $loader)\n+    {\n+        $loader->load(function (ContainerBuilder $container) {\n+            $container->prependExtensionConfig('framework', array(","path":"src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernel.php","position":61,"original_position":61,"commit_id":"62f0ba6898574be18fd7ec7e8e3ad9001b7e203c","original_commit_id":"62f0ba6898574be18fd7ec7e8e3ad9001b7e203c","user":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?v=3","gravatar_id":"","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"body":"`loadFromExtension` is enough here as we area always the first to be called.","created_at":"2015-09-29T08:25:09Z","updated_at":"2015-09-29T08:25:09Z","html_url":"https://github.com/symfony/symfony/pull/15948#discussion_r40645648","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/15948","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/40645648"},"html":{"href":"https://github.com/symfony/symfony/pull/15948#discussion_r40645648"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/15948"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/15948","id":46109773,"html_url":"https://github.com/symfony/symfony/pull/15948","diff_url":"https://github.com/symfony/symfony/pull/15948.diff","patch_url":"https://github.com/symfony/symfony/pull/15948.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/15948","number":15948,"state":"open","locked":false,"title":"[WIP] Route building in the kernel","user":{"login":"weaverryan","id":121003,"avatar_url":"https://avatars.githubusercontent.com/u/121003?v=3","gravatar_id":"","url":"https://api.github.com/users/weaverryan","html_url":"https://github.com/weaverryan","followers_url":"https://api.github.com/users/weaverryan/followers","following_url":"https://api.github.com/users/weaverryan/following{/other_user}","gists_url":"https://api.github.com/users/weaverryan/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverryan/subscriptions","organizations_url":"https://api.github.com/users/weaverryan/orgs","repos_url":"https://api.github.com/users/weaverryan/repos","events_url":"https://api.github.com/users/weaverryan/events{/privacy}","received_events_url":"https://api.github.com/users/weaverryan/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | no\r\n| Fixed tickets | Partially #15864\r\n| License       | MIT\r\n| Doc PR        | not yet\r\n\r\nWIP, because it depends on the unmerged PR's #15742, #15778 and #15820. But since this completes the picture (and I'm pushing this for 2.8), I needed to get this PR created.\r\n\r\nThe idea is to make a \"normal\" kernel look like this: https://gist.github.com/weaverryan/e4b19cabb1d9286c4217#file-smallkernel-php, which has some nice benefit that `routing_dev.yml` isn't needed anymore, because you can import those routes conditionally here.\r\n\r\nBut, you could also create an entire kernel without external files. A complex example (probably more complex than you'd have without using external files) is here: https://gist.github.com/weaverryan/e4b19cabb1d9286c4217#file-appkernel-php.\r\n\r\nThanks!","created_at":"2015-09-27T21:54:34Z","updated_at":"2015-09-29T08:25:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"879230925013c8d84ae9c78ed8624495516bf66c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/15948/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/15948/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15948/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/62f0ba6898574be18fd7ec7e8e3ad9001b7e203c","head":{"label":"weaverryan:framework_kernel_with_route_loading","ref":"framework_kernel_with_route_loading","sha":"62f0ba6898574be18fd7ec7e8e3ad9001b7e203c","user":{"login":"weaverryan","id":121003,"avatar_url":"https://avatars.githubusercontent.com/u/121003?v=3","gravatar_id":"","url":"https://api.github.com/users/weaverryan","html_url":"https://github.com/weaverryan","followers_url":"https://api.github.com/users/weaverryan/followers","following_url":"https://api.github.com/users/weaverryan/following{/other_user}","gists_url":"https://api.github.com/users/weaverryan/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverryan/subscriptions","organizations_url":"https://api.github.com/users/weaverryan/orgs","repos_url":"https://api.github.com/users/weaverryan/repos","events_url":"https://api.github.com/users/weaverryan/events{/privacy}","received_events_url":"https://api.github.com/users/weaverryan/received_events","type":"User","site_admin":false},"repo":{"id":21151556,"name":"symfony","full_name":"weaverryan/symfony","owner":{"login":"weaverryan","id":121003,"avatar_url":"https://avatars.githubusercontent.com/u/121003?v=3","gravatar_id":"","url":"https://api.github.com/users/weaverryan","html_url":"https://github.com/weaverryan","followers_url":"https://api.github.com/users/weaverryan/followers","following_url":"https://api.github.com/users/weaverryan/following{/other_user}","gists_url":"https://api.github.com/users/weaverryan/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverryan/subscriptions","organizations_url":"https://api.github.com/users/weaverryan/orgs","repos_url":"https://api.github.com/users/weaverryan/repos","events_url":"https://api.github.com/users/weaverryan/events{/privacy}","received_events_url":"https://api.github.com/users/weaverryan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weaverryan/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/weaverryan/symfony","forks_url":"https://api.github.com/repos/weaverryan/symfony/forks","keys_url":"https://api.github.com/repos/weaverryan/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaverryan/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaverryan/symfony/teams","hooks_url":"https://api.github.com/repos/weaverryan/symfony/hooks","issue_events_url":"https://api.github.com/repos/weaverryan/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/weaverryan/symfony/events","assignees_url":"https://api.github.com/repos/weaverryan/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/weaverryan/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/weaverryan/symfony/tags","blobs_url":"https://api.github.com/repos/weaverryan/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaverryan/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaverryan/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaverryan/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaverryan/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/weaverryan/symfony/languages","stargazers_url":"https://api.github.com/repos/weaverryan/symfony/stargazers","contributors_url":"https://api.github.com/repos/weaverryan/symfony/contributors","subscribers_url":"https://api.github.com/repos/weaverryan/symfony/subscribers","subscription_url":"https://api.github.com/repos/weaverryan/symfony/subscription","commits_url":"https://api.github.com/repos/weaverryan/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaverryan/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaverryan/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaverryan/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaverryan/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/weaverryan/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaverryan/symfony/merges","archive_url":"https://api.github.com/repos/weaverryan/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaverryan/symfony/downloads","issues_url":"https://api.github.com/repos/weaverryan/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/weaverryan/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/weaverryan/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/weaverryan/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaverryan/symfony/labels{/name}","releases_url":"https://api.github.com/repos/weaverryan/symfony/releases{/id}","created_at":"2014-06-24T04:00:07Z","updated_at":"2015-06-28T12:37:42Z","pushed_at":"2015-09-28T23:56:10Z","git_url":"git://github.com/weaverryan/symfony.git","ssh_url":"git@github.com:weaverryan/symfony.git","clone_url":"https://github.com/weaverryan/symfony.git","svn_url":"https://github.com/weaverryan/symfony","homepage":"symfony.com","size":61013,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:2.8","ref":"2.8","sha":"4b942741e58624557f9a23ad1c178ba6c31ee628","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}","created_at":"2010-01-04T14:21:21Z","updated_at":"2015-09-29T03:41:17Z","pushed_at":"2015-09-29T08:21:56Z","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":248577,"stargazers_count":10849,"watchers_count":10849,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4271,"mirror_url":null,"open_issues_count":912,"forks":4271,"open_issues":912,"watchers":10849,"default_branch":"2.8"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/15948"},"html":{"href":"https://github.com/symfony/symfony/pull/15948"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/15948"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/15948/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/15948/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/15948/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/62f0ba6898574be18fd7ec7e8e3ad9001b7e203c"}}}}