{"action":"created","comment":{"url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/comments/81585636","pull_request_review_id":2554959,"id":81585636,"diff_hunk":"@@ -700,6 +735,56 @@ public function setDirectives($directives)\n     }\n \n     /**\n+     * Get the auto expiring lifetime.\n+     *\n+     * Mainly a workaround for the issues that arise due to the fact that\n+     * Magento's Enterprise_PageCache module doesn't set any expiry.\n+     *\n+     * @param  int $specificLifetime\n+     * @param  string $id\n+     * @return int Cache life time\n+     */\n+    protected function _getAutoExpiringLifetime($lifetime, $id)\n+    {\n+        if ($lifetime) {\n+            // If it's already truthy, go with it.\n+            return $lifetime;\n+        }\n+\n+        $matches = $this->_matchesAutoExpiringPattern($id);\n+        if (!$matches) {\n+            // Only apply auto expire for keys that match the pattern\n+            return $lifetime;\n+        }\n+\n+        if ($this->_autoExpireLifetime > 0) {\n+            // Return the auto expire lifetime if set\n+            return $this->_autoExpireLifetime;\n+        }\n+\n+        // Return whatever it was set to.\n+        return $lifetime;\n+    }\n+\n+    protected function _matchesAutoExpiringPattern($id)\n+    {\n+        $matches = array();\n+        preg_match($this->_autoExpirePattern, $id, $matches);\n+\n+        return !empty($matches);\n+    }\n+\n+    public function setAutoExpireLifetime($lifetime)","path":"Cm/Cache/Backend/Redis.php","position":null,"original_position":119,"commit_id":"1fedfac44e1c3cc832236b4b28204f6e59e207cb","original_commit_id":"440530ce823d30c0c02143c72797251505b601fd","user":{"login":"mpchadwick","id":4132322,"avatar_url":"https://avatars.githubusercontent.com/u/4132322?v=3","gravatar_id":"","url":"https://api.github.com/users/mpchadwick","html_url":"https://github.com/mpchadwick","followers_url":"https://api.github.com/users/mpchadwick/followers","following_url":"https://api.github.com/users/mpchadwick/following{/other_user}","gists_url":"https://api.github.com/users/mpchadwick/gists{/gist_id}","starred_url":"https://api.github.com/users/mpchadwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpchadwick/subscriptions","organizations_url":"https://api.github.com/users/mpchadwick/orgs","repos_url":"https://api.github.com/users/mpchadwick/repos","events_url":"https://api.github.com/users/mpchadwick/events{/privacy}","received_events_url":"https://api.github.com/users/mpchadwick/received_events","type":"User","site_admin":false},"body":"@colinmollenhour Updated with a separate test case. I'm following the pattern introduced with `forceStandalone` where a protected property is used and can be changed in the new test case class. Happy to squash these down as a final step if you'd like.","created_at":"2016-10-03T16:23:54Z","updated_at":"2016-10-03T16:23:54Z","html_url":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/pull/111#discussion_r81585636","pull_request_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/comments/81585636"},"html":{"href":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/pull/111#discussion_r81585636"},"pull_request":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111","id":87588603,"html_url":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/pull/111","diff_url":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/pull/111.diff","patch_url":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/pull/111.patch","issue_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/issues/111","number":111,"state":"open","locked":false,"title":"Add Auto Expiry Feature","user":{"login":"mpchadwick","id":4132322,"avatar_url":"https://avatars.githubusercontent.com/u/4132322?v=3","gravatar_id":"","url":"https://api.github.com/users/mpchadwick","html_url":"https://github.com/mpchadwick","followers_url":"https://api.github.com/users/mpchadwick/followers","following_url":"https://api.github.com/users/mpchadwick/following{/other_user}","gists_url":"https://api.github.com/users/mpchadwick/gists{/gist_id}","starred_url":"https://api.github.com/users/mpchadwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpchadwick/subscriptions","organizations_url":"https://api.github.com/users/mpchadwick/orgs","repos_url":"https://api.github.com/users/mpchadwick/repos","events_url":"https://api.github.com/users/mpchadwick/events{/privacy}","received_events_url":"https://api.github.com/users/mpchadwick/received_events","type":"User","site_admin":false},"body":"Implementation of feature discussed in #110.","created_at":"2016-10-01T02:24:02Z","updated_at":"2016-10-03T16:23:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8722e0504dbc31954e6843c0a20e7e9b46015697","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111/commits","review_comments_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111/comments","review_comment_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/issues/111/comments","statuses_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/statuses/1fedfac44e1c3cc832236b4b28204f6e59e207cb","head":{"label":"mpchadwick:ee-pagecache-workaround","ref":"ee-pagecache-workaround","sha":"1fedfac44e1c3cc832236b4b28204f6e59e207cb","user":{"login":"mpchadwick","id":4132322,"avatar_url":"https://avatars.githubusercontent.com/u/4132322?v=3","gravatar_id":"","url":"https://api.github.com/users/mpchadwick","html_url":"https://github.com/mpchadwick","followers_url":"https://api.github.com/users/mpchadwick/followers","following_url":"https://api.github.com/users/mpchadwick/following{/other_user}","gists_url":"https://api.github.com/users/mpchadwick/gists{/gist_id}","starred_url":"https://api.github.com/users/mpchadwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpchadwick/subscriptions","organizations_url":"https://api.github.com/users/mpchadwick/orgs","repos_url":"https://api.github.com/users/mpchadwick/repos","events_url":"https://api.github.com/users/mpchadwick/events{/privacy}","received_events_url":"https://api.github.com/users/mpchadwick/received_events","type":"User","site_admin":false},"repo":{"id":69714969,"name":"Cm_Cache_Backend_Redis","full_name":"mpchadwick/Cm_Cache_Backend_Redis","owner":{"login":"mpchadwick","id":4132322,"avatar_url":"https://avatars.githubusercontent.com/u/4132322?v=3","gravatar_id":"","url":"https://api.github.com/users/mpchadwick","html_url":"https://github.com/mpchadwick","followers_url":"https://api.github.com/users/mpchadwick/followers","following_url":"https://api.github.com/users/mpchadwick/following{/other_user}","gists_url":"https://api.github.com/users/mpchadwick/gists{/gist_id}","starred_url":"https://api.github.com/users/mpchadwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpchadwick/subscriptions","organizations_url":"https://api.github.com/users/mpchadwick/orgs","repos_url":"https://api.github.com/users/mpchadwick/repos","events_url":"https://api.github.com/users/mpchadwick/events{/privacy}","received_events_url":"https://api.github.com/users/mpchadwick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mpchadwick/Cm_Cache_Backend_Redis","description":"A Zend_Cache backend for Redis with full support for tags (works great with Magento)","fork":true,"url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis","forks_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/forks","keys_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/teams","hooks_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/hooks","issue_events_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/issues/events{/number}","events_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/events","assignees_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/assignees{/user}","branches_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/branches{/branch}","tags_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/tags","blobs_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/statuses/{sha}","languages_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/languages","stargazers_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/stargazers","contributors_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/contributors","subscribers_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/subscribers","subscription_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/subscription","commits_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/contents/{+path}","compare_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/merges","archive_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/downloads","issues_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/issues{/number}","pulls_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/pulls{/number}","milestones_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/milestones{/number}","notifications_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/labels{/name}","releases_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/releases{/id}","deployments_url":"https://api.github.com/repos/mpchadwick/Cm_Cache_Backend_Redis/deployments","created_at":"2016-10-01T02:21:02Z","updated_at":"2016-10-01T02:21:03Z","pushed_at":"2016-10-03T16:22:32Z","git_url":"git://github.com/mpchadwick/Cm_Cache_Backend_Redis.git","ssh_url":"git@github.com:mpchadwick/Cm_Cache_Backend_Redis.git","clone_url":"https://github.com/mpchadwick/Cm_Cache_Backend_Redis.git","svn_url":"https://github.com/mpchadwick/Cm_Cache_Backend_Redis","homepage":"","size":131,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"colinmollenhour:master","ref":"master","sha":"6319714bb3a4fe699c5db0edb887f5e8fe40a6dc","user":{"login":"colinmollenhour","id":38738,"avatar_url":"https://avatars.githubusercontent.com/u/38738?v=3","gravatar_id":"","url":"https://api.github.com/users/colinmollenhour","html_url":"https://github.com/colinmollenhour","followers_url":"https://api.github.com/users/colinmollenhour/followers","following_url":"https://api.github.com/users/colinmollenhour/following{/other_user}","gists_url":"https://api.github.com/users/colinmollenhour/gists{/gist_id}","starred_url":"https://api.github.com/users/colinmollenhour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinmollenhour/subscriptions","organizations_url":"https://api.github.com/users/colinmollenhour/orgs","repos_url":"https://api.github.com/users/colinmollenhour/repos","events_url":"https://api.github.com/users/colinmollenhour/events{/privacy}","received_events_url":"https://api.github.com/users/colinmollenhour/received_events","type":"User","site_admin":false},"repo":{"id":3690632,"name":"Cm_Cache_Backend_Redis","full_name":"colinmollenhour/Cm_Cache_Backend_Redis","owner":{"login":"colinmollenhour","id":38738,"avatar_url":"https://avatars.githubusercontent.com/u/38738?v=3","gravatar_id":"","url":"https://api.github.com/users/colinmollenhour","html_url":"https://github.com/colinmollenhour","followers_url":"https://api.github.com/users/colinmollenhour/followers","following_url":"https://api.github.com/users/colinmollenhour/following{/other_user}","gists_url":"https://api.github.com/users/colinmollenhour/gists{/gist_id}","starred_url":"https://api.github.com/users/colinmollenhour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinmollenhour/subscriptions","organizations_url":"https://api.github.com/users/colinmollenhour/orgs","repos_url":"https://api.github.com/users/colinmollenhour/repos","events_url":"https://api.github.com/users/colinmollenhour/events{/privacy}","received_events_url":"https://api.github.com/users/colinmollenhour/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis","description":"A Zend_Cache backend for Redis with full support for tags (works great with Magento)","fork":false,"url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis","forks_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/forks","keys_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/teams","hooks_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/hooks","issue_events_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/issues/events{/number}","events_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/events","assignees_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/assignees{/user}","branches_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/branches{/branch}","tags_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/tags","blobs_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/statuses/{sha}","languages_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/languages","stargazers_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/stargazers","contributors_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/contributors","subscribers_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/subscribers","subscription_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/subscription","commits_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/contents/{+path}","compare_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/merges","archive_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/downloads","issues_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/issues{/number}","pulls_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls{/number}","milestones_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/milestones{/number}","notifications_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/labels{/name}","releases_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/releases{/id}","deployments_url":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/deployments","created_at":"2012-03-11T23:55:58Z","updated_at":"2016-09-19T10:45:54Z","pushed_at":"2016-10-03T16:22:33Z","git_url":"git://github.com/colinmollenhour/Cm_Cache_Backend_Redis.git","ssh_url":"git@github.com:colinmollenhour/Cm_Cache_Backend_Redis.git","clone_url":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis.git","svn_url":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis","homepage":"","size":210,"stargazers_count":300,"watchers_count":300,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":11,"forks":115,"open_issues":11,"watchers":300,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111"},"html":{"href":"https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/pull/111"},"issue":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/issues/111"},"comments":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/statuses/1fedfac44e1c3cc832236b4b28204f6e59e207cb"}}}}
{"actor":{"display_login":"mpchadwick"}}