tschoffelen / php-pkpass

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

Remote certificates can be used #83

Closed GCalmels closed 6 years ago

GCalmels commented 6 years ago

I changed file_exists by file_get_contents to fix this issue https://github.com/tschoffelen/php-pkpass/issues/82

tschoffelen commented 6 years ago

Problem with this is that it now retrieves the file twice, discarding it the first time. Especially when that file is remote, that might have a severe negative performance impact.

What I'd do is remove that check in setCertificate entirely, and add a check to see if the contents of the file are empty just after the actual file_get_contents that is being done later on.

GCalmels commented 6 years ago

I did not add a check if the content is empty because file_get_contents will do too ! Right ?