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
When setting the HOME env variable to the project root, phiremock has an internal conflict regarding the ~/.phiremock file or directory.
Problem description
For example, my home dir is /opt/app, my project is also installed there, so the compose vendor dir is /opt/app/vendor/.
The following happens in the file vendor/mcustiel/phiremock-server/src/Utils/Config/ConfigBuilder.php:
The getDefaultExpectationsDir() function will return /opt/app/.phiremock/expectations as directory, this directory will be created if it doesn't exists. Basicly, the /opt/app/.phiremock directory will be created.
The searchFileAndGetConfig() function will try /../../../../../../.phiremock as a config file, what will also end up as /opt/app/.phiremock. If file_exists returns true (it will), it will try to include that file, but in this case, it's a directory.
* Updated phar
* fix: check if phiremock config file is actually a file
* chore(#10): added php8.2 to scrutinizer
* fix: modified another file_exists check to be is_file
* chore: updated phiremock.phar
When setting the HOME env variable to the project root, phiremock has an internal conflict regarding the
~/.phiremock
file or directory.Problem description
For example, my home dir is
/opt/app
, my project is also installed there, so the compose vendor dir is/opt/app/vendor/
.The following happens in the file
vendor/mcustiel/phiremock-server/src/Utils/Config/ConfigBuilder.php
:getDefaultExpectationsDir()
function will return/opt/app/.phiremock/expectations
as directory, this directory will be created if it doesn't exists. Basicly, the/opt/app/.phiremock
directory will be created.searchFileAndGetConfig()
function will try/../../../../../../.phiremock
as a config file, what will also end up as/opt/app/.phiremock
. If file_exists returns true (it will), it will try to include that file, but in this case, it's a directory.This will throw the following exception:
Possible fix (untested)
In searchFileAndGetConfig(), we should check not only if the
file_exist
, but also ais_file()
:The text was updated successfully, but these errors were encountered: