-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoids errors when Extracting PHARs in class BinaryInstaller.php line 214 (PharData decompressing) #210
Avoids errors when Extracting PHARs in class BinaryInstaller.php line 214 (PharData decompressing) #210
Conversation
…ars, a phar with that name already exists' due to https://bugs.php.net/bug.php\?id\=75101
@beto-aveiga does #207 avoid this issue for you? |
@deviantintegral |
Opening |
@deviantintegral @justafish I just tried this today. I could replicate the PHAR extracting in Tugboat, then added it to the composer file and work. Please review this. Many thanks! |
FYI this is the error I was having in Tugboat:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read https://bugs.php.net/bug.php?id=75101 and I can see how this approach could be a fix for us.
I'm not sure how to reproduce the bug though.
$cacheDestination = $cacheFolder.\DIRECTORY_SEPARATOR.$fileName; | ||
$cacheDestination = $cacheFolder.\DIRECTORY_SEPARATOR.bin2hex(random_bytes(5)).$fileName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an implementation of the suggested quick fix from https://bugs.php.net/bug.php?id=75101
Quick fix would be to copy the file to a temporary location so it has a different name and doesn't get cached.
https://www.w3schools.com/php/phptryit.asp?filename=tryphp_compiler
gives a result like 4f06fe1a59 or 050b9c8d10
Seems a good length and character set for adding to a filename.
If you switch to global binaries as in the other PR, this code isn't called for task or local-security-checker. However, this is still worth fixing given that's opt in and we need to support this setup until at least the next major version of Drainpipe. |
Description
It avoids errors when extracting PHARs.
Possibly related to: https://bugs.php.net/bug.php\?id\=75101
More information in the linked ticket below.
Solves
#135