spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
568 stars 102 forks source link

Update SettingsFactory.php #655

Closed jozydapozy closed 2 years ago

jozydapozy commented 2 years ago

The bug described in https://github.com/spatie/ray/issues/73 is still present in Ray. When code is run on shutdown, the result of getcwd() is /. (see this comment on php.net)

So when you run this:

register_shutdown_function(function () {
    ray('hello world');
});

the method searchConfigFilesOnDisk() will start searching in / triggering an unwanted 'is_dir(): open_basedir restriction in effect E_WARNING

This pull request will fix this by stop searching any further when the path is /

jozydapozy commented 2 years ago

I do see that this is not a full solution. On another installtion I see getcwd() returning /var/www/cgi-bin/cgi_wrapper

freekmurze commented 2 years ago

I'm going to pass on this for now.