Closed djschilling closed 5 months ago
That's weird, for me it worked. I am using PhpStorm as well. Can you tell me what PhpStorm version you are using and your OS?
PhpStorm 2023.3.2 MacOS: Sonoma 14.1.1 (23B81)
My Debugging Settings:
I can step into the library Code and eventually come to the proxied file, but that is very complicated.
Maybe the cacheDir is the problem? This is how my kernel looks like:
<?php
namespace Churchtools\Lib\Aop;
use Churchtools\Lib\Config\Environment;
use Okapi\Aop\AopKernel;
class CTAopKernel extends AopKernel {
protected array $aspects = [];
protected function preInit(): void {
$this->cacheDir = sys_get_temp_dir() . '/ct-aop-cache/' . BUILD_VERSION;
parent::preInit();
}
protected function configureOptions(): void {
$this->environment = Environment::isLocal()
? \Okapi\CodeTransformer\Core\Options\Environment::DEVELOPMENT
: \Okapi\CodeTransformer\Core\Options\Environment::PRODUCTION;
}
}
I'll check it out. Can you also tell me in if the file you're trying to debug the line number of the breakpoint corresponds to the same line number in the proxy file? For example echo "Hello";
on line 27 should have the same code in the proxy on line 27.
I see what the problem is, cached files return the path to their location while non-cached files are passed through the StreamFilter
WITH their original file path. I have to route all files through the StreamFilter
first and then it should work
Just to make sure this is not a MacOS problem, could you delete your cache directory and test if the very first run of your code debugs the original file?
Just tested it. Without the cache it is working.
Any updates here? Would be really good if debugging would work properly.
Hi @djschilling,
sorry for the late reply, had some health problems I needed to take care of first.
I fixed it and tested it on Windows, let me know if this works for you :)
When using this lib debugging gets harder. I cannot set a breakpoint in a File that gets proxied from this lib.
Can this be improved? I am using PHPStorm.