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

Docker Webgrind ignores index.php by default and is not configurable. #130

Open
johnrom opened this issue Jun 18, 2020 · 2 comments · May be fixed by #147 or #148
Open

Docker Webgrind ignores index.php by default and is not configurable. #130

johnrom opened this issue Jun 18, 2020 · 2 comments · May be fixed by #147 or #148

Comments

@johnrom
Copy link

johnrom commented Jun 18, 2020

Webgrind is ignoring index.php by default because of the following default setting:

    static $hideWebgrindProfiles = true;

This means WordPress, which uses index.php to route all requests, does not show profiles for normal page loads. I wasn't able to find a way to configure this without overriding the config file itself, which isn't a future-proof solution.

In docker, xdebug isn't even installed and webgrind will never profile itself.

@kasparsd
Copy link

Could we use the /** DOCKER:ENABLE **/ flag to toggle the $hideWebgrindProfiles value?

@bartoszgadomski
Copy link

FYI, I solved this by creating custom Docker image and modifying the $hideWebgrindProfiles variable during the image build process:

FROM jokkedk/webgrind:1.9.2

# WordPress requests goes through index.php file, while webgrind treats index.php profiles
# as its internal ones. Altering this setting solves the issue.
RUN sed -i 's/static $hideWebgrindProfiles = true;/static $hideWebgrindProfiles = false;/' config.php

It's not perfect, but works 🤷‍♂️

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