Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler support when using Slim 4 #667

Open
UlrichEckhardt opened this issue Jan 16, 2024 · 1 comment
Open

Profiler support when using Slim 4 #667

UlrichEckhardt opened this issue Jan 16, 2024 · 1 comment

Comments

@UlrichEckhardt
Copy link
Contributor

Greetings!

In the past, I have been trying to get Clockwork to allow profiling a Slim application and couldn't get it to run. Since that app uses a fork of Clockwork and is generally a bit special, I didn't bother investigating further. Anyhow, I just cobbled togethere a quick demo project and it shows the same behaviour. Note that there is also #617, but that is relatively unspecific and lacks quite some info.

Debugging through the code, I found a few things that may be involved:

  • XdebugDataSource -- It looks like this needs to be registered. For Laravel (your main target framework?) this is done automatically, but not for Slim 4.
  • xdebug.start_with_request=yes instead of trigger seems to make a difference, too. With it set to yes, sometimes I don't get the message that "Profile is not present for current request." in the browser, though not always. Instead, I get the message "Processing profile..." and a rotating dot, but no profile.
  • Looking at the request data, I see that it contains "XDEBUG_PROFILE=; clockwork-profile=; XDEBUG_PROFILE=1" in the Cookie header, note the double XDEBUG_PROFILE there. Sometimes it's only "clockwork-profile=; XDEBUG_PROFILE=1" instead, not sure why.
  • I see that in some Clockwork storage files, the profileData is set, so recording of that data works.
  • A verbatim URL your.app/clockwork in the browser doesn't work. Neither does localhost:8080/clockwork. It seems like this requires some support which wasn't implemented for Slim yet.

At this point I'm a bit stumped and am looking for help here...

Uli

@itsgoingd
Copy link
Owner

Hey, I guess you've ended up figuring this out based on the other issues.

The Slim integration is definitively our weakest one. The only reason it exists is because I used to use Slim when I first started writing Clockwork. I have stopped using Slim like 10 years ago, so the integration also fell behind, only receiving minimal effort updates to support Slim 3 and 4 (which I have never used on any project myself, lol).

Honestly, at this point it might be a better idea to use our vanilla integration, which is way more up-to-date and should play nicely with Slim's PSR-compatible router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants