tschoffelen / php-pkpass

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

Possible to save .pkpass File on Server? #51

Closed mrweix closed 8 years ago

mrweix commented 8 years ago

Is it possible to save the generated .pkpass file directly on the server instead of downloading it?

tschoffelen commented 8 years ago

Yes, that's quite simple: if you have a instance $pass (see examples/example.php for full usage), simply call $pass->create(false) and save the output:

 $pass_content = $pass->create(false); // adding false keeps it from downloading
 if(!$pass_content){
    die('Something went wrong.');
 }

 file_put_contents('mypass.pkpass', $pass_content); // save to a file, first param is filename
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.