tschoffelen / php-pkpass

💳 PHP class for creating passes for Wallet on iOS.
https://includable.com
MIT License
908 stars 187 forks source link

PKPass file could not be opened due PHP notice written to file #73

Closed CodeBrauer closed 6 years ago

CodeBrauer commented 6 years ago

So I generated the file but it couldn't be opened. Console App just showed so errors like:

30.11.17 10:58:14,033 com.apple.PassXPCService[7692]: PAPassController: Failed to unarchive file file:///var/folders/f2/27mglkvn37g72_v3ggmgzv_800010b/T/com.apple.PassXPCService/084D0B88-160F-4A62-A6B9-B4329624A752/pass.pkpass to file:///var/folders/f2/27mglkvn37g72_v3ggmgzv_800010b/T/com.apple.PassXPCService/F5A129B7-FA68-404C-A4CB-112A1AF9083A/ - Error 2
30.11.17 10:58:14,034 Pass Viewer[7677]: ERROR: Error Domain=NSCocoaErrorDomain Code=-1 "-[NSUnarchiver unarchiveObjectWithData:] failed" UserInfo={NSLocalizedFailureReason=-[NSUnarchiver unarchiveObjectWithData:] failed}

So I just inspected the pkpass file itself: And had this error:

Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in
/Users/xx/xxxxx/vendor/pkpass/pkpass/src/PKPass.php on line 301.

PHP Version: 7.0.15 @ macOS 10.11

binron commented 6 years ago

Set display errors to '0': ini_set('display_errors', '0');

For CLI you can set it also to 'stderr': ini_set('display_errors', 'stderr');

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.