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
This has been bugging me a lot. When running a test file directly in PhpStorm, like this image, you sometimes get weird errors where Hyde tries to find files in that directory, causing unexpected results. However, if you re-run the test it works as normal, making it hard to debug.
Now, I added some breakpoints to kill the execution at various points and I think this is caused by the Hyde base path not being properly initialized. Why this only affects the first run I don't know. But I think it's because we set the base path using getcwd():
This allows the HydeCLI executable to be stored in a different directory, however if the runner is initiated from another location that could mess things up. I suggest we change the implementation to use dirname(__DIR__)), same as we use to register the Laravel Application:
It's very easy to change the base path at runtime, so if one is creating an integration that needs the cwd or another arbitrary path, that's easy enough to change with Hyde::setBasePath($dir).
I'm doing some preliminary testing with this fix applied, and so far it seems to work. But since reproducing it is so unpredictable it's hard to fully confirm.
The text was updated successfully, but these errors were encountered:
This has been bugging me a lot. When running a test file directly in PhpStorm, like this image, you sometimes get weird errors where Hyde tries to find files in that directory, causing unexpected results. However, if you re-run the test it works as normal, making it hard to debug.
Now, I added some breakpoints to kill the execution at various points and I think this is caused by the Hyde base path not being properly initialized. Why this only affects the first run I don't know. But I think it's because we set the base path using
getcwd()
:develop/app/bootstrap.php
Line 48 in ab9882d
This allows the HydeCLI executable to be stored in a different directory, however if the runner is initiated from another location that could mess things up. I suggest we change the implementation to use
dirname(__DIR__))
, same as we use to register the Laravel Application:develop/app/bootstrap.php
Line 15 in ab9882d
It's very easy to change the base path at runtime, so if one is creating an integration that needs the cwd or another arbitrary path, that's easy enough to change with
Hyde::setBasePath($dir)
.I'm doing some preliminary testing with this fix applied, and so far it seems to work. But since reproducing it is so unpredictable it's hard to fully confirm.
The text was updated successfully, but these errors were encountered: