tschoffelen / php-pkpass

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

Could not find package pkpass/pkpass #55

Closed antonioreyna closed 8 years ago

antonioreyna commented 8 years ago

Hello, I am trying to install it and i get this message:

 [InvalidArgumentException]
  Could not find package pkpass/pkpass at any version for your minimum-stabil
  ity (stable). Check the package spelling or your minimum-stability

I on laravel 5.2.41

tschoffelen commented 8 years ago

try composer require pkpass/pkpass@dev-master

antonioreyna commented 8 years ago

hi, yes that worked, now im having this error.

filesize(): stat failed for /tmp/PKPass579fd76f631658.54142659/pass.pkpass
antonioreyna commented 8 years ago

i think the problem is here:

PKPass.php

        // Get contents of generated file
        $file = file_get_contents($paths['pkpass']);
262- $this->clean();  <-- you remove the files here

        // Output pass
        if ($output == true) {
            $fileName = ($this->getName()) ? $this->getName() : basename($paths['pkpass']);
            header('Pragma: no-cache');
            header('Content-type: application/vnd.apple.pkpass');
269-   header('Content-length: ' . filesize($paths['pkpass'])); <--- you has for the file previously removed here

did this instead:


        // Get contents of generated file
        $file = file_get_contents($paths['pkpass']);
        $size = filesize($paths['pkpass']);
        $this->clean();

        // Output pass
        if ($output == true) {
            $fileName = ($this->getName()) ? $this->getName() : basename($paths['pkpass']);
            header('Pragma: no-cache');
            header('Content-type: application/vnd.apple.pkpass');
            header('Content-length: ' . $size);
            header('Content-Disposition: attachment; filename="' . $fileName . '"');

Let me know if thats ok and to check if you do an update to update the package on my project.

Thanks!

tschoffelen commented 8 years ago

Yes, that seems to work perfectly! Would you mind doing a pull request with that change?

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.