{"action":"created","issue":{"url":"https://api.github.com/repos/Mangopay/mangopay2-php-sdk/issues/236","repository_url":"https://api.github.com/repos/Mangopay/mangopay2-php-sdk","labels_url":"https://api.github.com/repos/Mangopay/mangopay2-php-sdk/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/Mangopay/mangopay2-php-sdk/issues/236/comments","events_url":"https://api.github.com/repos/Mangopay/mangopay2-php-sdk/issues/236/events","html_url":"https://github.com/Mangopay/mangopay2-php-sdk/issues/236","id":309286510,"node_id":"MDU6SXNzdWUzMDkyODY1MTA=","number":236,"title":" MangoPay   Libraries  : ","user":{"login":"Manu2V","id":37852734,"node_id":"MDQ6VXNlcjM3ODUyNzM0","avatar_url":"https://avatars1.githubusercontent.com/u/37852734?v=4","gravatar_id":"","url":"https://api.github.com/users/Manu2V","html_url":"https://github.com/Manu2V","followers_url":"https://api.github.com/users/Manu2V/followers","following_url":"https://api.github.com/users/Manu2V/following{/other_user}","gists_url":"https://api.github.com/users/Manu2V/gists{/gist_id}","starred_url":"https://api.github.com/users/Manu2V/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manu2V/subscriptions","organizations_url":"https://api.github.com/users/Manu2V/orgs","repos_url":"https://api.github.com/users/Manu2V/repos","events_url":"https://api.github.com/users/Manu2V/events{/privacy}","received_events_url":"https://api.github.com/users/Manu2V/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-28T09:24:13Z","updated_at":"2018-06-20T13:19:48Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nThans for your help, i have this problem on mangopay but i don't understand how i can resolve it in the code ?\r\n\r\nin \r\n    $serialized = serialize($token);\r\n    $result = file_put_contents($this->GetPathToFile(), $this->_prefixContent . $serialized, LOCK_EX);\r\n    if ($result === false)\r\n        throw new \\MangoPay\\Libraries\\Exception('Cannot put token to file');\r\nOn my web site, sometimes it works sometimes the message \"MangoPay\\Exception Message: Cannot put token to file\" appears and don't permit the payment via mangopay.\r\n\r\nCan you help me please,\r\n\r\nManu"},"comment":{"url":"https://api.github.com/repos/Mangopay/mangopay2-php-sdk/issues/comments/398745546","html_url":"https://github.com/Mangopay/mangopay2-php-sdk/issues/236#issuecomment-398745546","issue_url":"https://api.github.com/repos/Mangopay/mangopay2-php-sdk/issues/236","id":398745546,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODc0NTU0Ng==","user":{"login":"paulhristea","id":12606661,"node_id":"MDQ6VXNlcjEyNjA2NjYx","avatar_url":"https://avatars1.githubusercontent.com/u/12606661?v=4","gravatar_id":"","url":"https://api.github.com/users/paulhristea","html_url":"https://github.com/paulhristea","followers_url":"https://api.github.com/users/paulhristea/followers","following_url":"https://api.github.com/users/paulhristea/following{/other_user}","gists_url":"https://api.github.com/users/paulhristea/gists{/gist_id}","starred_url":"https://api.github.com/users/paulhristea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulhristea/subscriptions","organizations_url":"https://api.github.com/users/paulhristea/orgs","repos_url":"https://api.github.com/users/paulhristea/repos","events_url":"https://api.github.com/users/paulhristea/events{/privacy}","received_events_url":"https://api.github.com/users/paulhristea/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T13:19:48Z","updated_at":"2018-06-20T13:19:48Z","author_association":"CONTRIBUTOR","body":"Hello @Manu2V!\r\n\r\nThanks for reaching out, and sorry about the delayed response.\r\nIs there any chance that the `Store($token)` function is being called from multiple threads at the same time? At first sight, this could be the cause of your occasional problem, because we are writing to the file using the `LOCK_EX` flag, which means that the file gets locked while we are writing to it, so nobody else will be allowed to write at the same time. This is what might cause the `$result` value to be false.\r\n\r\nPlease get back to us with more details about how to reproduce this error if it is not the case.\r\nThank you!"}}
{"actor":{"display_login":"paulhristea"}}