{"action":"closed","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/7522","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/7522/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7522/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/7522/events","html_url":"https://github.com/cakephp/cakephp/issues/7522","id":110478561,"number":7522,"title":"FileEngine::increment and ::decrement","user":{"login":"garethellis36","id":6451455,"avatar_url":"https://avatars.githubusercontent.com/u/6451455?v=3","gravatar_id":"","url":"https://api.github.com/users/garethellis36","html_url":"https://github.com/garethellis36","followers_url":"https://api.github.com/users/garethellis36/followers","following_url":"https://api.github.com/users/garethellis36/following{/other_user}","gists_url":"https://api.github.com/users/garethellis36/gists{/gist_id}","starred_url":"https://api.github.com/users/garethellis36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethellis36/subscriptions","organizations_url":"https://api.github.com/users/garethellis36/orgs","repos_url":"https://api.github.com/users/garethellis36/repos","events_url":"https://api.github.com/users/garethellis36/events{/privacy}","received_events_url":"https://api.github.com/users/garethellis36/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-08T15:41:05Z","updated_at":"2015-10-08T16:46:17Z","closed_at":"2015-10-08T16:46:17Z","body":"I see that these are not implemented at present. I got caught out recently when I switched a 2.x app over from using Wincache to using File and our tests didn't cover some usage of `Cache::increment()` and `Cache::decrement()`.\r\n\r\nIs there a reason this isn't implemented for `FileEngine` as something like:\r\n\r\n```php\r\npublic function increment($key, $offset = 1) {\r\n    $value = $this->read($key);\r\n    if (!$value) {\r\n        return false;\r\n    }\r\n    return $this->write($key, $value + $offset);\r\n}\r\n```\r\n\r\nThis is essentially the code that I am using in our app after switching away from Wincache. Happy to submit a PR if appropriate."}}