{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/comments/181649776","pull_request_review_id":112310930,"id":181649776,"diff_hunk":"@@ -36,11 +37,15 @@\n         \"php-http/mock-client\": \"^0.3.2\",\n         \"phpunit/phpunit\": \"^5.7 || ^6.0\",\n         \"symfony/process\": \"^2.3 || ^3.0 || ^4.0\",\n-        \"symfony/http-kernel\": \"^2.3 || ^3.0 || ^4.0\"\n+        \"symfony/http-kernel\": \"^2.3 || ^3.0 || ^4.0\",\n+        \"symfony/psr-http-message-bridge\": \"^1.0\",\n+        \"zendframework/zend-diactoros\": \"^1.7\"\n     },\n     \"suggest\": {\n         \"friendsofsymfony/http-cache-bundle\": \"For integration with the Symfony framework\",\n-        \"monolog/monolog\": \"For logging issues while invalidating\"\n+        \"monolog/monolog\": \"For logging issues while invalidating\",\n+        \"symfony/psr-http-message-bridge\": \"If you need direct routing for Symfony.\",","path":"composer.json","position":null,"original_position":21,"commit_id":"b04699281a4eda1121edbd41a8331f7afdbf116e","original_commit_id":"9fef6947950bbd1e19e17a3484ac0320fdda8a40","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},"body":"You're right, done in b04699281a4eda1121edbd41a8331f7afdbf116e.","created_at":"2018-04-16T07:59:25Z","updated_at":"2018-04-16T07:59:26Z","html_url":"https://github.com/FriendsOfSymfony/FOSHttpCache/pull/419#discussion_r181649776","pull_request_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/comments/181649776"},"html":{"href":"https://github.com/FriendsOfSymfony/FOSHttpCache/pull/419#discussion_r181649776"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419"}},"in_reply_to_id":181641167},"pull_request":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419","id":181253830,"html_url":"https://github.com/FriendsOfSymfony/FOSHttpCache/pull/419","diff_url":"https://github.com/FriendsOfSymfony/FOSHttpCache/pull/419.diff","patch_url":"https://github.com/FriendsOfSymfony/FOSHttpCache/pull/419.patch","issue_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/419","number":419,"state":"open","locked":false,"title":"[RFC] Allow to directly route proxy requests in case of Symfony proxy","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},"body":"For simple single node setups I would like to simplify the Symfony proxy setup.\r\nRight now FOSHttpCache executes a real external `PURGE` or `PURGETAGS` request which forces you to configure and know the target domain which is not necessarily easy for apps like CMS'es that are usually set up on the server directly without knowing the target domain beforehand.\r\n\r\nThis should be easier for simple single node setups so here's my approach.\r\n\r\nDocs:\r\n\r\n1. Your `Kernel` has to implement the `HttpCacheAwareKernelInterface` (you can use the `HttpCacheAwareKernel` trait to simplify things):\r\n\r\n```php\r\nclass MyKernel implements HttpCacheAwareKernelInterface\r\n{\r\n    use HttpCacheAwareKernel;\r\n}\r\n```\r\n\r\n2. In the `index.php` you set the `HttpCache` to your `MyKernel` so the bundle is able to access the `HttpCache` instance from the DIC like so:\r\n\r\n```php\r\n$kernel = new MyKernel('prod', false);\r\n$httpCache = new HttpCache($kernel);\r\n$kernel->setHttpCache($httpCache);\r\n\r\n$request = Request::createFromGlobals();\r\n$response = $httpCache->handle($request);\r\n```\r\n\r\nConfiguration for the bundle is simple. You only need to add `127.0.0.1` to the servers and use the new `KernelClient` service (see https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/pull/440):\r\n\r\n```diff\r\nfos_http_cache:\r\n    proxy_client:\r\n        symfony:\r\n            tags_header: My-Cache-Tags\r\n            tags_method: TAGPURGE\r\n            header_length: 1234\r\n            purge_method: PURGE\r\n            http:   \r\n                servers:\r\n                    - '127.0.0.1'\r\n                http_client: 'fos_http_cache.symfony.kernel_client'\r\n```\r\n\r\nThe `KernelClient` handles the request by making sure, the IP is set to `127.0.0.1`, converting via PSR-7 requests and responses and sending it directly to the `HttpCache`.\r\n\r\nI've integrated everything and it works like a charm. If you like the concept, I'll be happy to finish that with tests.","created_at":"2018-04-12T16:07:45Z","updated_at":"2018-04-16T07:59:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9801e6a6908ab7f6098dc9670f1c5f705767ae88","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419/commits","review_comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419/comments","review_comment_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/419/comments","statuses_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/statuses/b04699281a4eda1121edbd41a8331f7afdbf116e","head":{"label":"Toflar:allow-direct-routing-for-symfony","ref":"allow-direct-routing-for-symfony","sha":"b04699281a4eda1121edbd41a8331f7afdbf116e","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},"repo":{"id":84095371,"name":"FOSHttpCache","full_name":"Toflar/FOSHttpCache","owner":{"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},"private":false,"html_url":"https://github.com/Toflar/FOSHttpCache","description":"Integrate your PHP application with your HTTP caching proxy","fork":true,"url":"https://api.github.com/repos/Toflar/FOSHttpCache","forks_url":"https://api.github.com/repos/Toflar/FOSHttpCache/forks","keys_url":"https://api.github.com/repos/Toflar/FOSHttpCache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Toflar/FOSHttpCache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Toflar/FOSHttpCache/teams","hooks_url":"https://api.github.com/repos/Toflar/FOSHttpCache/hooks","issue_events_url":"https://api.github.com/repos/Toflar/FOSHttpCache/issues/events{/number}","events_url":"https://api.github.com/repos/Toflar/FOSHttpCache/events","assignees_url":"https://api.github.com/repos/Toflar/FOSHttpCache/assignees{/user}","branches_url":"https://api.github.com/repos/Toflar/FOSHttpCache/branches{/branch}","tags_url":"https://api.github.com/repos/Toflar/FOSHttpCache/tags","blobs_url":"https://api.github.com/repos/Toflar/FOSHttpCache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Toflar/FOSHttpCache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Toflar/FOSHttpCache/git/refs{/sha}","trees_url":"https://api.github.com/repos/Toflar/FOSHttpCache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Toflar/FOSHttpCache/statuses/{sha}","languages_url":"https://api.github.com/repos/Toflar/FOSHttpCache/languages","stargazers_url":"https://api.github.com/repos/Toflar/FOSHttpCache/stargazers","contributors_url":"https://api.github.com/repos/Toflar/FOSHttpCache/contributors","subscribers_url":"https://api.github.com/repos/Toflar/FOSHttpCache/subscribers","subscription_url":"https://api.github.com/repos/Toflar/FOSHttpCache/subscription","commits_url":"https://api.github.com/repos/Toflar/FOSHttpCache/commits{/sha}","git_commits_url":"https://api.github.com/repos/Toflar/FOSHttpCache/git/commits{/sha}","comments_url":"https://api.github.com/repos/Toflar/FOSHttpCache/comments{/number}","issue_comment_url":"https://api.github.com/repos/Toflar/FOSHttpCache/issues/comments{/number}","contents_url":"https://api.github.com/repos/Toflar/FOSHttpCache/contents/{+path}","compare_url":"https://api.github.com/repos/Toflar/FOSHttpCache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Toflar/FOSHttpCache/merges","archive_url":"https://api.github.com/repos/Toflar/FOSHttpCache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Toflar/FOSHttpCache/downloads","issues_url":"https://api.github.com/repos/Toflar/FOSHttpCache/issues{/number}","pulls_url":"https://api.github.com/repos/Toflar/FOSHttpCache/pulls{/number}","milestones_url":"https://api.github.com/repos/Toflar/FOSHttpCache/milestones{/number}","notifications_url":"https://api.github.com/repos/Toflar/FOSHttpCache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Toflar/FOSHttpCache/labels{/name}","releases_url":"https://api.github.com/repos/Toflar/FOSHttpCache/releases{/id}","deployments_url":"https://api.github.com/repos/Toflar/FOSHttpCache/deployments","created_at":"2017-03-06T16:27:48Z","updated_at":"2017-03-06T16:27:51Z","pushed_at":"2018-04-16T07:59:16Z","git_url":"git://github.com/Toflar/FOSHttpCache.git","ssh_url":"git@github.com:Toflar/FOSHttpCache.git","clone_url":"https://github.com/Toflar/FOSHttpCache.git","svn_url":"https://github.com/Toflar/FOSHttpCache","homepage":"https://foshttpcache.readthedocs.io","size":1191,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FriendsOfSymfony:master","ref":"master","sha":"cde09646ccbf7f4bf28a5f76a78138ef8f5bc7dc","user":{"login":"FriendsOfSymfony","id":529709,"avatar_url":"https://avatars1.githubusercontent.com/u/529709?v=4","gravatar_id":"","url":"https://api.github.com/users/FriendsOfSymfony","html_url":"https://github.com/FriendsOfSymfony","followers_url":"https://api.github.com/users/FriendsOfSymfony/followers","following_url":"https://api.github.com/users/FriendsOfSymfony/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfSymfony/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfSymfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfSymfony/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfSymfony/orgs","repos_url":"https://api.github.com/users/FriendsOfSymfony/repos","events_url":"https://api.github.com/users/FriendsOfSymfony/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfSymfony/received_events","type":"Organization","site_admin":false},"repo":{"id":16147914,"name":"FOSHttpCache","full_name":"FriendsOfSymfony/FOSHttpCache","owner":{"login":"FriendsOfSymfony","id":529709,"avatar_url":"https://avatars1.githubusercontent.com/u/529709?v=4","gravatar_id":"","url":"https://api.github.com/users/FriendsOfSymfony","html_url":"https://github.com/FriendsOfSymfony","followers_url":"https://api.github.com/users/FriendsOfSymfony/followers","following_url":"https://api.github.com/users/FriendsOfSymfony/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfSymfony/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfSymfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfSymfony/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfSymfony/orgs","repos_url":"https://api.github.com/users/FriendsOfSymfony/repos","events_url":"https://api.github.com/users/FriendsOfSymfony/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfSymfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FriendsOfSymfony/FOSHttpCache","description":"Integrate your PHP application with your HTTP caching proxy","fork":false,"url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache","forks_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/forks","keys_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/teams","hooks_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/hooks","issue_events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/events{/number}","events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/events","assignees_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/assignees{/user}","branches_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/branches{/branch}","tags_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/tags","blobs_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/git/refs{/sha}","trees_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/statuses/{sha}","languages_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/languages","stargazers_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/stargazers","contributors_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/contributors","subscribers_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/subscribers","subscription_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/subscription","commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/commits{/sha}","git_commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/git/commits{/sha}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/comments{/number}","issue_comment_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/comments{/number}","contents_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/contents/{+path}","compare_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/merges","archive_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/downloads","issues_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues{/number}","pulls_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls{/number}","milestones_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/milestones{/number}","notifications_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/labels{/name}","releases_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/releases{/id}","deployments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/deployments","created_at":"2014-01-22T18:19:17Z","updated_at":"2018-04-10T19:20:32Z","pushed_at":"2018-04-16T07:59:18Z","git_url":"git://github.com/FriendsOfSymfony/FOSHttpCache.git","ssh_url":"git@github.com:FriendsOfSymfony/FOSHttpCache.git","clone_url":"https://github.com/FriendsOfSymfony/FOSHttpCache.git","svn_url":"https://github.com/FriendsOfSymfony/FOSHttpCache","homepage":"https://foshttpcache.readthedocs.io","size":1181,"stargazers_count":191,"watchers_count":191,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":42,"open_issues":11,"watchers":191,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419"},"html":{"href":"https://github.com/FriendsOfSymfony/FOSHttpCache/pull/419"},"issue":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/419"},"comments":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/issues/419/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419/comments"},"review_comment":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/pulls/419/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSHttpCache/statuses/b04699281a4eda1121edbd41a8331f7afdbf116e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Toflar"}}