{"action":"opened","issue":{"url":"https://api.github.com/repos/keboola/php-temp/issues/4","repository_url":"https://api.github.com/repos/keboola/php-temp","labels_url":"https://api.github.com/repos/keboola/php-temp/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/keboola/php-temp/issues/4/comments","events_url":"https://api.github.com/repos/keboola/php-temp/issues/4/events","html_url":"https://github.com/keboola/php-temp/issues/4","id":139838704,"number":4,"title":"Issue when long filename is passed to Temp::createFile()","user":{"login":"jobrieniii","id":178399,"avatar_url":"https://avatars.githubusercontent.com/u/178399?v=3","gravatar_id":"","url":"https://api.github.com/users/jobrieniii","html_url":"https://github.com/jobrieniii","followers_url":"https://api.github.com/users/jobrieniii/followers","following_url":"https://api.github.com/users/jobrieniii/following{/other_user}","gists_url":"https://api.github.com/users/jobrieniii/gists{/gist_id}","starred_url":"https://api.github.com/users/jobrieniii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobrieniii/subscriptions","organizations_url":"https://api.github.com/users/jobrieniii/orgs","repos_url":"https://api.github.com/users/jobrieniii/repos","events_url":"https://api.github.com/users/jobrieniii/events{/privacy}","received_events_url":"https://api.github.com/users/jobrieniii/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-10T09:54:03Z","updated_at":"2016-03-10T09:54:03Z","closed_at":null,"body":"Ran into an issue when using `php-jsonparser` in cases where extreme path depth since filesystem couldn't write the file (in this case Mac OSX, 255 limit).\r\n\r\nFrom my standpoint,  since this function  just creates Temp files that it could be handled by updating the createFile function to simply hash the filename passed to it to ensure uniqueness but not get fail if passed an extremely long filename.\r\n\r\nMy recommended fix was something like this:\r\n\r\n```\r\n    public function createFile($fileName, $preserve = false)\r\n    {\r\n        $this->initRunFolder();\r\n\r\n        $fileInfo = new \\SplFileInfo($this->getTmpPath() . '/' . sha1($fileName));\r\n\r\n        $pathName = $fileInfo->getPathname();\r\n\r\n        if (!file_exists(dirname($pathName))) {\r\n            mkdir(dirname($pathName), 0777, true);\r\n        }\r\n\r\n        touch($pathName);\r\n        $this->files[] = array(\r\n            'filename' => $fileName,\r\n            'file'  => $fileInfo,\r\n            'preserve'  => $preserve\r\n        );\r\n        chmod($pathName, 0600);\r\n\r\n        return $fileInfo;\r\n    }\r\n\r\n```\r\n\r\nIf you are open to the change, I can submit a pull request."}}