{"action":"created","comment":{"url":"https://api.github.com/repos/twigphp/Twig/pulls/comments/39265566","id":39265566,"diff_hunk":"@@ -242,13 +258,9 @@ public function setCache($cache)\n      */\n     public function getCacheFilename($name)","path":"lib/Twig/Environment.php","position":111,"original_position":77,"commit_id":"67a945697efa3faacacf467f68166015a5068a17","original_commit_id":"81468f9ef2a2d009944ead2598eb1990de25b511","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":"I've done the same strategy as for the write method.","created_at":"2015-09-11T12:23:31Z","updated_at":"2015-09-11T12:23:31Z","html_url":"https://github.com/twigphp/Twig/pull/1812#discussion_r39265566","pull_request_url":"https://api.github.com/repos/twigphp/Twig/pulls/1812","_links":{"self":{"href":"https://api.github.com/repos/twigphp/Twig/pulls/comments/39265566"},"html":{"href":"https://github.com/twigphp/Twig/pull/1812#discussion_r39265566"},"pull_request":{"href":"https://api.github.com/repos/twigphp/Twig/pulls/1812"}}},"pull_request":{"url":"https://api.github.com/repos/twigphp/Twig/pulls/1812","id":44753631,"html_url":"https://github.com/twigphp/Twig/pull/1812","diff_url":"https://github.com/twigphp/Twig/pull/1812.diff","patch_url":"https://github.com/twigphp/Twig/pull/1812.patch","issue_url":"https://api.github.com/repos/twigphp/Twig/issues/1812","number":1812,"state":"open","locked":false,"title":"Extracted the filesystem cache to its own class","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":"Twig caches the compiled PHP classes on the filesystem. This is **always** the best strategy as it allows Twig to automatically benefit from PHP opcache/APC. But overriding how the classes are stored on the filesystem is difficult with the current way, so this PR proposes to extract this logic to its own class (that should allow Drupal to stop copy/pasting some Twig code and accessing private code - see #1811).\r\n\r\nThis PR also unifies the no-cache feature by extracting it to its own class as well.\r\n\r\nBC is kept and the `false` and `$dir` caching strategies are still supported.\r\n\r\nThe `Twig_Cache_Interface` can be used to create other cache classes, but that's not documented and should only be used with extreme care (performance-wise). It means that Twig itself will **never** ship with other implementations like Memcache, Redis, whatever storage is hype nowadays. This should fix #1421 (this PR builds on top of it), #1573, #1415, #741, #728.\r\n","created_at":"2015-09-11T07:27:57Z","updated_at":"2015-09-11T12:23:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34528f3bdfb5e99f72e4d8e13d31868cb34129d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twigphp/Twig/pulls/1812/commits","review_comments_url":"https://api.github.com/repos/twigphp/Twig/pulls/1812/comments","review_comment_url":"https://api.github.com/repos/twigphp/Twig/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twigphp/Twig/issues/1812/comments","statuses_url":"https://api.github.com/repos/twigphp/Twig/statuses/67a945697efa3faacacf467f68166015a5068a17","head":{"label":"fabpot:template-cache","ref":"template-cache","sha":"67a945697efa3faacacf467f68166015a5068a17","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},"repo":{"id":25424710,"name":"Twig","full_name":"fabpot/Twig","owner":{"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},"private":false,"html_url":"https://github.com/fabpot/Twig","description":"Twig, the flexible, fast, and secure template language for PHP","fork":true,"url":"https://api.github.com/repos/fabpot/Twig","forks_url":"https://api.github.com/repos/fabpot/Twig/forks","keys_url":"https://api.github.com/repos/fabpot/Twig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabpot/Twig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabpot/Twig/teams","hooks_url":"https://api.github.com/repos/fabpot/Twig/hooks","issue_events_url":"https://api.github.com/repos/fabpot/Twig/issues/events{/number}","events_url":"https://api.github.com/repos/fabpot/Twig/events","assignees_url":"https://api.github.com/repos/fabpot/Twig/assignees{/user}","branches_url":"https://api.github.com/repos/fabpot/Twig/branches{/branch}","tags_url":"https://api.github.com/repos/fabpot/Twig/tags","blobs_url":"https://api.github.com/repos/fabpot/Twig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabpot/Twig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabpot/Twig/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabpot/Twig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabpot/Twig/statuses/{sha}","languages_url":"https://api.github.com/repos/fabpot/Twig/languages","stargazers_url":"https://api.github.com/repos/fabpot/Twig/stargazers","contributors_url":"https://api.github.com/repos/fabpot/Twig/contributors","subscribers_url":"https://api.github.com/repos/fabpot/Twig/subscribers","subscription_url":"https://api.github.com/repos/fabpot/Twig/subscription","commits_url":"https://api.github.com/repos/fabpot/Twig/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabpot/Twig/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabpot/Twig/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabpot/Twig/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabpot/Twig/contents/{+path}","compare_url":"https://api.github.com/repos/fabpot/Twig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabpot/Twig/merges","archive_url":"https://api.github.com/repos/fabpot/Twig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabpot/Twig/downloads","issues_url":"https://api.github.com/repos/fabpot/Twig/issues{/number}","pulls_url":"https://api.github.com/repos/fabpot/Twig/pulls{/number}","milestones_url":"https://api.github.com/repos/fabpot/Twig/milestones{/number}","notifications_url":"https://api.github.com/repos/fabpot/Twig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabpot/Twig/labels{/name}","releases_url":"https://api.github.com/repos/fabpot/Twig/releases{/id}","created_at":"2014-10-19T11:11:25Z","updated_at":"2015-08-14T02:59:39Z","pushed_at":"2015-09-11T12:23:14Z","git_url":"git://github.com/fabpot/Twig.git","ssh_url":"git@github.com:fabpot/Twig.git","clone_url":"https://github.com/fabpot/Twig.git","svn_url":"https://github.com/fabpot/Twig","homepage":"http://twig.sensiolabs.org/","size":6680,"stargazers_count":33,"watchers_count":33,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":0,"forks":18,"open_issues":0,"watchers":33,"default_branch":"master"}},"base":{"label":"twigphp:1.x","ref":"1.x","sha":"788870ec3402cd478e4dbdacc258a6950c21dadd","user":{"login":"twigphp","id":5296178,"avatar_url":"https://avatars.githubusercontent.com/u/5296178?v=3","gravatar_id":"","url":"https://api.github.com/users/twigphp","html_url":"https://github.com/twigphp","followers_url":"https://api.github.com/users/twigphp/followers","following_url":"https://api.github.com/users/twigphp/following{/other_user}","gists_url":"https://api.github.com/users/twigphp/gists{/gist_id}","starred_url":"https://api.github.com/users/twigphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twigphp/subscriptions","organizations_url":"https://api.github.com/users/twigphp/orgs","repos_url":"https://api.github.com/users/twigphp/repos","events_url":"https://api.github.com/users/twigphp/events{/privacy}","received_events_url":"https://api.github.com/users/twigphp/received_events","type":"Organization","site_admin":false},"repo":{"id":330275,"name":"Twig","full_name":"twigphp/Twig","owner":{"login":"twigphp","id":5296178,"avatar_url":"https://avatars.githubusercontent.com/u/5296178?v=3","gravatar_id":"","url":"https://api.github.com/users/twigphp","html_url":"https://github.com/twigphp","followers_url":"https://api.github.com/users/twigphp/followers","following_url":"https://api.github.com/users/twigphp/following{/other_user}","gists_url":"https://api.github.com/users/twigphp/gists{/gist_id}","starred_url":"https://api.github.com/users/twigphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twigphp/subscriptions","organizations_url":"https://api.github.com/users/twigphp/orgs","repos_url":"https://api.github.com/users/twigphp/repos","events_url":"https://api.github.com/users/twigphp/events{/privacy}","received_events_url":"https://api.github.com/users/twigphp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twigphp/Twig","description":"Twig, the flexible, fast, and secure template language for PHP","fork":false,"url":"https://api.github.com/repos/twigphp/Twig","forks_url":"https://api.github.com/repos/twigphp/Twig/forks","keys_url":"https://api.github.com/repos/twigphp/Twig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twigphp/Twig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twigphp/Twig/teams","hooks_url":"https://api.github.com/repos/twigphp/Twig/hooks","issue_events_url":"https://api.github.com/repos/twigphp/Twig/issues/events{/number}","events_url":"https://api.github.com/repos/twigphp/Twig/events","assignees_url":"https://api.github.com/repos/twigphp/Twig/assignees{/user}","branches_url":"https://api.github.com/repos/twigphp/Twig/branches{/branch}","tags_url":"https://api.github.com/repos/twigphp/Twig/tags","blobs_url":"https://api.github.com/repos/twigphp/Twig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twigphp/Twig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twigphp/Twig/git/refs{/sha}","trees_url":"https://api.github.com/repos/twigphp/Twig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twigphp/Twig/statuses/{sha}","languages_url":"https://api.github.com/repos/twigphp/Twig/languages","stargazers_url":"https://api.github.com/repos/twigphp/Twig/stargazers","contributors_url":"https://api.github.com/repos/twigphp/Twig/contributors","subscribers_url":"https://api.github.com/repos/twigphp/Twig/subscribers","subscription_url":"https://api.github.com/repos/twigphp/Twig/subscription","commits_url":"https://api.github.com/repos/twigphp/Twig/commits{/sha}","git_commits_url":"https://api.github.com/repos/twigphp/Twig/git/commits{/sha}","comments_url":"https://api.github.com/repos/twigphp/Twig/comments{/number}","issue_comment_url":"https://api.github.com/repos/twigphp/Twig/issues/comments{/number}","contents_url":"https://api.github.com/repos/twigphp/Twig/contents/{+path}","compare_url":"https://api.github.com/repos/twigphp/Twig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twigphp/Twig/merges","archive_url":"https://api.github.com/repos/twigphp/Twig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twigphp/Twig/downloads","issues_url":"https://api.github.com/repos/twigphp/Twig/issues{/number}","pulls_url":"https://api.github.com/repos/twigphp/Twig/pulls{/number}","milestones_url":"https://api.github.com/repos/twigphp/Twig/milestones{/number}","notifications_url":"https://api.github.com/repos/twigphp/Twig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twigphp/Twig/labels{/name}","releases_url":"https://api.github.com/repos/twigphp/Twig/releases{/id}","created_at":"2009-10-07T21:23:38Z","updated_at":"2015-09-10T16:19:20Z","pushed_at":"2015-09-11T12:23:15Z","git_url":"git://github.com/twigphp/Twig.git","ssh_url":"git@github.com:twigphp/Twig.git","clone_url":"https://github.com/twigphp/Twig.git","svn_url":"https://github.com/twigphp/Twig","homepage":"http://twig.sensiolabs.org/","size":13845,"stargazers_count":2851,"watchers_count":2851,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":728,"mirror_url":null,"open_issues_count":66,"forks":728,"open_issues":66,"watchers":2851,"default_branch":"1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/twigphp/Twig/pulls/1812"},"html":{"href":"https://github.com/twigphp/Twig/pull/1812"},"issue":{"href":"https://api.github.com/repos/twigphp/Twig/issues/1812"},"comments":{"href":"https://api.github.com/repos/twigphp/Twig/issues/1812/comments"},"review_comments":{"href":"https://api.github.com/repos/twigphp/Twig/pulls/1812/comments"},"review_comment":{"href":"https://api.github.com/repos/twigphp/Twig/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twigphp/Twig/pulls/1812/commits"},"statuses":{"href":"https://api.github.com/repos/twigphp/Twig/statuses/67a945697efa3faacacf467f68166015a5068a17"}}}}