{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/cache/issues/121","labels_url":"https://api.github.com/repos/doctrine/cache/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/cache/issues/121/comments","events_url":"https://api.github.com/repos/doctrine/cache/issues/121/events","html_url":"https://github.com/doctrine/cache/issues/121","id":122547753,"number":121,"title":"FileCache.php bug at line 140 in protected function getFilename","user":{"login":"mtal","id":3755160,"avatar_url":"https://avatars.githubusercontent.com/u/3755160?v=3","gravatar_id":"","url":"https://api.github.com/users/mtal","html_url":"https://github.com/mtal","followers_url":"https://api.github.com/users/mtal/followers","following_url":"https://api.github.com/users/mtal/following{/other_user}","gists_url":"https://api.github.com/users/mtal/gists{/gist_id}","starred_url":"https://api.github.com/users/mtal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtal/subscriptions","organizations_url":"https://api.github.com/users/mtal/orgs","repos_url":"https://api.github.com/users/mtal/repos","events_url":"https://api.github.com/users/mtal/events{/privacy}","received_events_url":"https://api.github.com/users/mtal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-16T16:36:41Z","updated_at":"2015-12-19T01:17:50Z","closed_at":"2015-12-19T01:17:50Z","body":"(($this->isRunningOnWindows && $this->directoryStringLength + 4 + strlen($id) * 2 + $this->extensionStringLength) > 259) is always false\r\nBECAUSE\r\n($this->isRunningOnWindows && $this->directoryStringLength + 4 + strlen($id) * 2 + $this->extensionStringLength) is boolean\r\nAND \r\n259 is too high for windows which cause \"fopen failed to open stream: Invalid argument doctrine cache\"\r\n\r\nOriginal\r\n```PHP\r\n    protected function getFilename($id)\r\n    {\r\n        $hash = hash('sha256', $id);\r\n\r\n        // This ensures that the filename is unique and that there are no invalid chars in it.\r\n        if (\r\n            '' === $id\r\n            || ((strlen($id) * 2 + $this->extensionStringLength) > 255)\r\n            || (($this->isRunningOnWindows && $this->directoryStringLength + 4 + strlen($id) * 2 + $this->extensionStringLength) > 259)\r\n        ) {\r\n            // Most filesystems have a limit of 255 chars for each path component. On Windows the the whole path is limited\r\n            // to 260 chars (including terminating null char). Using long UNC (\"\\\\?\\\" prefix) does not work with the PHP API.\r\n            // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents\r\n            // collisions between the hash and bin2hex.\r\n            $filename = '_' . $hash;\r\n        } else {\r\n            $filename = bin2hex($id);\r\n        }\r\n```"},"comment":{"url":"https://api.github.com/repos/doctrine/cache/issues/comments/165930800","html_url":"https://github.com/doctrine/cache/issues/121#issuecomment-165930800","issue_url":"https://api.github.com/repos/doctrine/cache/issues/121","id":165930800,"user":{"login":"zeroedin-bill","id":4266849,"avatar_url":"https://avatars.githubusercontent.com/u/4266849?v=3","gravatar_id":"","url":"https://api.github.com/users/zeroedin-bill","html_url":"https://github.com/zeroedin-bill","followers_url":"https://api.github.com/users/zeroedin-bill/followers","following_url":"https://api.github.com/users/zeroedin-bill/following{/other_user}","gists_url":"https://api.github.com/users/zeroedin-bill/gists{/gist_id}","starred_url":"https://api.github.com/users/zeroedin-bill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeroedin-bill/subscriptions","organizations_url":"https://api.github.com/users/zeroedin-bill/orgs","repos_url":"https://api.github.com/users/zeroedin-bill/repos","events_url":"https://api.github.com/users/zeroedin-bill/events{/privacy}","received_events_url":"https://api.github.com/users/zeroedin-bill/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T01:17:50Z","updated_at":"2015-12-19T01:17:50Z","body":"Should be resolved in master and 1.5.3"}}