Open temp opened 4 years ago
Short assessment:
Name is actually not "unpredictable". It's case is changed to all lower.
The main difference between the two installations is that the first actually downloads the phar while the second uses the one from our local phar storage.
It further looks like that we, for the first, use the name as provided by the download location but store it in an all lower case variant in our storage. Given that the following installation relies on the name from the storage, the case changes.
That's clearly broken ;) but not sure yet if it's easy to fix in a BC compliant way.
I'll think about it. Nice catch!
Another example, this time changing not only upper/lower case:
$ phive.phar install --force-accept-unsigned wapmorgan/PhpCodeAnalyzer
Phive 0.13.2 - Copyright (C) 2015-2020 by Arne Blankerts, Sebastian Heuer and Contributors
Downloading https://github.com/wapmorgan/PhpCodeAnalyzer/releases/download/1.0.6/phpca.phar
Linking /Users/swentz/.phive/phars/wapmorgan/phpcodeanalyzer-1.0.6.phar to /Users/swentz/bla/tools/phpca
$ phive.phar install --force-accept-unsigned wapmorgan/PhpCodeAnalyzer
Phive 0.13.2 - Copyright (C) 2015-2020 by Arne Blankerts, Sebastian Heuer and Contributors
Linking /Users/swentz/.phive/phars/wapmorgan/phpcodeanalyzer-1.0.6.phar to /Users/swentz/bla/tools/phpcodeanalyzer
$ ls tools/
phpca
phpcodeanalyzer
Same original problem though: We use the name from the download (phpca.phar) for one, and our stored project name for the other.
Certainly an interesting bug but still not sure what a BC compliant fix would be?
Certainly an interesting bug but still not sure what a BC compliant fix would be?
Use symlinks and create both files as BC layer. The next major only uses one clearly specified name.
When I installed phpdocumentor several times, I get different executable names... phpDocumentor and phpdocumentor.
Here is a recording of an example, inside of an alpine docker image with php 7.3:
Relevant lines:
Linking /root/.phive/phars/phpdocumentor-2.9.0.phar to /tmp/foo/tools/phpDocumentor
andLinking /root/.phive/phars/phpdocumentor-2.9.0.phar to /tmp/bar/tools/phpdocumentor