You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PHP function realpath does not work when trying to resolve relative paths within the Phar file. This is mentioned in the documentation as well.
The function realpath() will not work for a file which is inside a Phar as such path would be a virtual path, not a real one.
There are three places I could find where this function is used. Two of them are in the path of FinderTool::findComposerJson but this is already addressed by changes in #29. The second place is in FinderTool::validateConfig in finding schema.json.
Steps to reproduce
This is reproducible after the changes in #29 and a box configuration file that includes schema.json. When run on a project which contains a configuration file (such as this very package (https://github.com/ramsey/conventional-commits)), the script crashes with an error:
PHP Fatal error: Uncaught ValueError: Path cannot be empty in phar:///Users/hw/work/php/conventional-commits/bin/conventional-commits.phar/src/ConventionalCommits/Configuration/FinderTool.php:173
This is because realpath returns false and it gets cast to an empty string.
Description
This is related to #25.
The PHP function
realpath
does not work when trying to resolve relative paths within the Phar file. This is mentioned in the documentation as well.There are three places I could find where this function is used. Two of them are in the path of
FinderTool::findComposerJson
but this is already addressed by changes in #29. The second place is inFinderTool::validateConfig
in findingschema.json
.Steps to reproduce
This is reproducible after the changes in #29 and a box configuration file that includes
schema.json
. When run on a project which contains a configuration file (such as this very package (https://github.com/ramsey/conventional-commits)), the script crashes with an error:This is because
realpath
returnsfalse
and it gets cast to an empty string.Expected behavior
The script should not crash.
Screenshots or output
Stack trace
Environment details
main
branchThe text was updated successfully, but these errors were encountered: