{"action":"created","comment":{"url":"https://api.github.com/repos/contao/core-bundle/pulls/comments/42110634","id":42110634,"diff_hunk":"@@ -0,0 +1,478 @@\n+<?php\n+\n+/*\n+ * This file is part of Contao.\n+ *\n+ * Copyright (c) 2005-2015 Leo Feyer\n+ *\n+ * @license LGPL-3.0+\n+ */\n+\n+namespace Contao\\CoreBundle\\Framework;\n+\n+use Contao\\ClassLoader;\n+use Contao\\CoreBundle\\ContaoCoreBundle;\n+use Contao\\CoreBundle\\Framework\\Adapter;\n+use Contao\\CoreBundle\\Framework\\Adapter\\AdapterInterface;\n+use Contao\\CoreBundle\\Exception\\AjaxRedirectResponseException;\n+use Contao\\CoreBundle\\Exception\\IncompleteInstallationException;\n+use Contao\\CoreBundle\\Exception\\InvalidRequestTokenException;\n+use Contao\\Input;\n+use Contao\\System;\n+use Symfony\\Component\\DependencyInjection\\ContainerAwareTrait;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+use Symfony\\Component\\HttpFoundation\\RequestStack;\n+use Symfony\\Component\\HttpFoundation\\Session\\SessionInterface;\n+use Symfony\\Component\\Routing\\RouterInterface;\n+use Symfony\\Component\\Security\\Csrf\\CsrfToken;\n+use Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface;\n+\n+/**\n+ * Initializes the Contao framework.\n+ *\n+ * @author Christian Schiffler <https://github.com/discordier>\n+ * @author Yanick Witschi <https://github.com/toflar>\n+ * @author Leo Feyer <https://github.com/leofeyer>\n+ * @author Dominik Tomasi <https://github.com/dtomasi>\n+ * @author Andreas Schempp <https://github.com/aschempp>\n+ */\n+class ContaoFramework implements ContaoFrameworkInterface\n+{\n+    use ContainerAwareTrait;\n+\n+    /**\n+     * @var RouterInterface\n+     */\n+    private $router;\n+\n+    /**\n+     * @var CsrfTokenManagerInterface\n+     */\n+    private $tokenManager;\n+\n+    /**\n+     * @var SessionInterface\n+     */\n+    private $session;\n+\n+    /**\n+     * @var string\n+     */\n+    private $rootDir;\n+\n+    /**\n+     * @var AdapterInterface\n+     */\n+    private $config;\n+\n+    /**\n+     * @var string\n+     */\n+    private $csrfTokenName;\n+\n+    /**\n+     * @var int\n+     */\n+    private $errorLevel;\n+\n+    /**\n+     * @var RequestStack\n+     */\n+    private $requestStack;\n+\n+    /**\n+     * @var Request\n+     */\n+    private $request;\n+\n+    /**\n+     * @var bool\n+     */\n+    private static $initialized = false;\n+\n+    /**\n+     * @var array\n+     */\n+    private $basicClasses = [\n+        'System',\n+        'Config',\n+        'ClassLoader',\n+        'TemplateLoader',\n+        'ModuleLoader',\n+    ];\n+\n+    /**\n+     * Adapter class cache\n+     * @var array\n+     */\n+    private $adapterCache = [];\n+\n+    /**\n+     * Constructor.\n+     *\n+     * @param RequestStack              $requestStack  The request stack\n+     * @param RouterInterface           $router        The router service\n+     * @param SessionInterface          $session       The session service\n+     * @param string                    $rootDir       The kernel root directory\n+     * @param CsrfTokenManagerInterface $tokenManager  The token manager service\n+     * @param string                    $csrfTokenName The name of the token\n+     * @param AdapterInterface          $config        The config adapter object\n+     * @param int                       $errorLevel    The PHP error level\n+     */\n+    public function __construct(\n+        RequestStack $requestStack,\n+        RouterInterface $router,\n+        SessionInterface $session,\n+        $rootDir,\n+        CsrfTokenManagerInterface $tokenManager,\n+        $csrfTokenName,\n+        $config = null,","path":"src/Framework/ContaoFramework.php","position":129,"original_position":129,"commit_id":"ca3822d7edd8b1fe0008e57d861e57a5f094770d","original_commit_id":"ca3822d7edd8b1fe0008e57d861e57a5f094770d","user":{"login":"aschempp","id":1073273,"avatar_url":"https://avatars.githubusercontent.com/u/1073273?v=3","gravatar_id":"","url":"https://api.github.com/users/aschempp","html_url":"https://github.com/aschempp","followers_url":"https://api.github.com/users/aschempp/followers","following_url":"https://api.github.com/users/aschempp/following{/other_user}","gists_url":"https://api.github.com/users/aschempp/gists{/gist_id}","starred_url":"https://api.github.com/users/aschempp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschempp/subscriptions","organizations_url":"https://api.github.com/users/aschempp/orgs","repos_url":"https://api.github.com/users/aschempp/repos","events_url":"https://api.github.com/users/aschempp/events{/privacy}","received_events_url":"https://api.github.com/users/aschempp/received_events","type":"User","site_admin":false},"body":"The argument is not optional, as you must always set the `$errorLevel` variable that follows it…","created_at":"2015-10-15T11:12:05Z","updated_at":"2015-10-15T11:12:05Z","html_url":"https://github.com/contao/core-bundle/pull/346#discussion_r42110634","pull_request_url":"https://api.github.com/repos/contao/core-bundle/pulls/346","_links":{"self":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/comments/42110634"},"html":{"href":"https://github.com/contao/core-bundle/pull/346#discussion_r42110634"},"pull_request":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/346"}}},"pull_request":{"url":"https://api.github.com/repos/contao/core-bundle/pulls/346","id":45037649,"html_url":"https://github.com/contao/core-bundle/pull/346","diff_url":"https://github.com/contao/core-bundle/pull/346.diff","patch_url":"https://github.com/contao/core-bundle/pull/346.patch","issue_url":"https://api.github.com/repos/contao/core-bundle/issues/346","number":346,"state":"open","locked":false,"title":"[RFC] Added a general adapter factory","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},"body":"So this is the first attempt for the general adapter factory we discussed last week.\r\n\r\nOpen questions:\r\n* [ ] It is in the nature of things that the adapter classes cannot be tested so I cannot write more unit tests for this, really. How do we ensure it's the way we want it to be before merging it? Should @ausi rebase and use it in his Image PR?\r\n","created_at":"2015-09-15T11:28:33Z","updated_at":"2015-10-15T11:12:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb4ba9bfff7c45a0ccb10c5fa562a48e4e750fb5","assignee":{"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},"milestone":{"url":"https://api.github.com/repos/contao/core-bundle/milestones/4","html_url":"https://github.com/contao/core-bundle/milestones/4.1.0","labels_url":"https://api.github.com/repos/contao/core-bundle/milestones/4/labels","id":1108381,"number":4,"title":"4.1.0","description":"Contao 4.1.0 (minor release)","creator":{"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},"open_issues":15,"closed_issues":4,"state":"open","created_at":"2015-05-13T11:06:24Z","updated_at":"2015-10-15T09:39:02Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/contao/core-bundle/pulls/346/commits","review_comments_url":"https://api.github.com/repos/contao/core-bundle/pulls/346/comments","review_comment_url":"https://api.github.com/repos/contao/core-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contao/core-bundle/issues/346/comments","statuses_url":"https://api.github.com/repos/contao/core-bundle/statuses/ca3822d7edd8b1fe0008e57d861e57a5f094770d","head":{"label":"Toflar:feature/adapters","ref":"feature/adapters","sha":"ca3822d7edd8b1fe0008e57d861e57a5f094770d","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},"repo":{"id":26642166,"name":"core-bundle","full_name":"Toflar/core-bundle","owner":{"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},"private":false,"html_url":"https://github.com/Toflar/core-bundle","description":"Contao 4 core bundle","fork":true,"url":"https://api.github.com/repos/Toflar/core-bundle","forks_url":"https://api.github.com/repos/Toflar/core-bundle/forks","keys_url":"https://api.github.com/repos/Toflar/core-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Toflar/core-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Toflar/core-bundle/teams","hooks_url":"https://api.github.com/repos/Toflar/core-bundle/hooks","issue_events_url":"https://api.github.com/repos/Toflar/core-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/Toflar/core-bundle/events","assignees_url":"https://api.github.com/repos/Toflar/core-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/Toflar/core-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/Toflar/core-bundle/tags","blobs_url":"https://api.github.com/repos/Toflar/core-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Toflar/core-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Toflar/core-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Toflar/core-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Toflar/core-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/Toflar/core-bundle/languages","stargazers_url":"https://api.github.com/repos/Toflar/core-bundle/stargazers","contributors_url":"https://api.github.com/repos/Toflar/core-bundle/contributors","subscribers_url":"https://api.github.com/repos/Toflar/core-bundle/subscribers","subscription_url":"https://api.github.com/repos/Toflar/core-bundle/subscription","commits_url":"https://api.github.com/repos/Toflar/core-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Toflar/core-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Toflar/core-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Toflar/core-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Toflar/core-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/Toflar/core-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Toflar/core-bundle/merges","archive_url":"https://api.github.com/repos/Toflar/core-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Toflar/core-bundle/downloads","issues_url":"https://api.github.com/repos/Toflar/core-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/Toflar/core-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/Toflar/core-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/Toflar/core-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Toflar/core-bundle/labels{/name}","releases_url":"https://api.github.com/repos/Toflar/core-bundle/releases{/id}","created_at":"2014-11-14T14:32:10Z","updated_at":"2015-04-18T14:10:14Z","pushed_at":"2015-10-15T10:02:20Z","git_url":"git://github.com/Toflar/core-bundle.git","ssh_url":"git@github.com:Toflar/core-bundle.git","clone_url":"https://github.com/Toflar/core-bundle.git","svn_url":"https://github.com/Toflar/core-bundle","homepage":"","size":24032,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"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":"develop"}},"base":{"label":"contao:develop","ref":"develop","sha":"35c9f69e88076d53cb682444e1240f8d36b1a64e","user":{"login":"contao","id":1206136,"avatar_url":"https://avatars.githubusercontent.com/u/1206136?v=3","gravatar_id":"","url":"https://api.github.com/users/contao","html_url":"https://github.com/contao","followers_url":"https://api.github.com/users/contao/followers","following_url":"https://api.github.com/users/contao/following{/other_user}","gists_url":"https://api.github.com/users/contao/gists{/gist_id}","starred_url":"https://api.github.com/users/contao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contao/subscriptions","organizations_url":"https://api.github.com/users/contao/orgs","repos_url":"https://api.github.com/users/contao/repos","events_url":"https://api.github.com/users/contao/events{/privacy}","received_events_url":"https://api.github.com/users/contao/received_events","type":"Organization","site_admin":false},"repo":{"id":20519851,"name":"core-bundle","full_name":"contao/core-bundle","owner":{"login":"contao","id":1206136,"avatar_url":"https://avatars.githubusercontent.com/u/1206136?v=3","gravatar_id":"","url":"https://api.github.com/users/contao","html_url":"https://github.com/contao","followers_url":"https://api.github.com/users/contao/followers","following_url":"https://api.github.com/users/contao/following{/other_user}","gists_url":"https://api.github.com/users/contao/gists{/gist_id}","starred_url":"https://api.github.com/users/contao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contao/subscriptions","organizations_url":"https://api.github.com/users/contao/orgs","repos_url":"https://api.github.com/users/contao/repos","events_url":"https://api.github.com/users/contao/events{/privacy}","received_events_url":"https://api.github.com/users/contao/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contao/core-bundle","description":"Contao 4 core bundle","fork":false,"url":"https://api.github.com/repos/contao/core-bundle","forks_url":"https://api.github.com/repos/contao/core-bundle/forks","keys_url":"https://api.github.com/repos/contao/core-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contao/core-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contao/core-bundle/teams","hooks_url":"https://api.github.com/repos/contao/core-bundle/hooks","issue_events_url":"https://api.github.com/repos/contao/core-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/contao/core-bundle/events","assignees_url":"https://api.github.com/repos/contao/core-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/contao/core-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/contao/core-bundle/tags","blobs_url":"https://api.github.com/repos/contao/core-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contao/core-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contao/core-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/contao/core-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contao/core-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/contao/core-bundle/languages","stargazers_url":"https://api.github.com/repos/contao/core-bundle/stargazers","contributors_url":"https://api.github.com/repos/contao/core-bundle/contributors","subscribers_url":"https://api.github.com/repos/contao/core-bundle/subscribers","subscription_url":"https://api.github.com/repos/contao/core-bundle/subscription","commits_url":"https://api.github.com/repos/contao/core-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/contao/core-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/contao/core-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/contao/core-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/contao/core-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/contao/core-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contao/core-bundle/merges","archive_url":"https://api.github.com/repos/contao/core-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contao/core-bundle/downloads","issues_url":"https://api.github.com/repos/contao/core-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/contao/core-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/contao/core-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/contao/core-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contao/core-bundle/labels{/name}","releases_url":"https://api.github.com/repos/contao/core-bundle/releases{/id}","created_at":"2014-06-05T09:45:55Z","updated_at":"2015-09-23T19:21:30Z","pushed_at":"2015-10-15T10:02:20Z","git_url":"git://github.com/contao/core-bundle.git","ssh_url":"git@github.com:contao/core-bundle.git","clone_url":"https://github.com/contao/core-bundle.git","svn_url":"https://github.com/contao/core-bundle","homepage":"","size":29654,"stargazers_count":28,"watchers_count":28,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":35,"forks":12,"open_issues":35,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/346"},"html":{"href":"https://github.com/contao/core-bundle/pull/346"},"issue":{"href":"https://api.github.com/repos/contao/core-bundle/issues/346"},"comments":{"href":"https://api.github.com/repos/contao/core-bundle/issues/346/comments"},"review_comments":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/346/comments"},"review_comment":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/346/commits"},"statuses":{"href":"https://api.github.com/repos/contao/core-bundle/statuses/ca3822d7edd8b1fe0008e57d861e57a5f094770d"}}}}