1

I see that the weird issue with DIR and Xdebug issue has been addressed, but am still confused.

Using php v7.3 and Xdebug v3.0.4, I'm having a problem with a plugin that doesn't seem to be finding some Composer-managed dependencies in my Docker dev container and am hoping to use Xdebug to trace the issue.

However:

  • file_exists( __DIR__ . '/autoload-classmap.php') is evaluating to false
  • because __DIR__ == "xdebug:"
  • and of course false == is_dir(__DIR__).

In the Xdebug functions docs, it suggests ignoring a particular directory:

xdebug_set_filter( XDEBUG_FILTER_TRACING, XDEBUG_PATH_EXCLUDE, [ __DIR__ . "/some/Dir" ] );

But __DIR__ isn't a directory (evaluates as xdebug:). Where in the codebase is this filter supposed to go. Where is it that __DIR__ is still a directory?

Would it be added to the configuration in the IDE somehow? I'm using VS Code.

MikeiLL
  • 6,282
  • 5
  • 37
  • 68
  • 1
    Please, edit your question and include the exact version numbers, just in case they are relevant for potential answerers. – yivi Sep 09 '21 at 15:23
  • Just to be clear, are you saying **your actual code** fails under XDebug, or just that **evaluating the expression in the debug console / watchlist** fails? Because [as the author of XDebug points out here](https://stackoverflow.com/a/20251991/157957) you can't get a run-time value for a compile-time constant. – IMSoP Sep 09 '21 at 17:22
  • Actual code fails, with or without Xdebug. I think it’s failing to load an autoload file, which is pointed at via __DIR__. Tried assigning __DIR__ to a $var but still seems to show the runtime Xdebug value. – MikeiLL Sep 09 '21 at 17:45

0 Answers0