amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

OpCache guy does only show #65

Open snack753 opened 3 years ago

snack753 commented 3 years ago

Using the OpCache gui in Moodle I only can see very limited information/links on the screen instead of the nice information that you present on your site.

Any idea why the details are missing for me?

image
abias commented 3 years ago

@amnuts , just as a note from my side: I asked @snack753 to ask this question here as I don't have an idea why this problem should be caused by the Moodle wrapper plugin.

amnuts commented 3 years ago

@snack753, there's nothing specifically in the opcache gui that would restrict showing so much information. At the very least you should be able to see the 'General information' and 'Directives' details about the 'Available functions'. So at the moment I would need more information before making any kind of guess as to what's going on.

If you open the browser developer tools, does the console show any errors in the react stuff that would stop it working?

If you get the output of a call to phpinfo(), what do your opcache settings look like? There might be some configuration that is making it act differently and I might need to compensate for it (if that were the case, though, I'd only make the changes to the latest version and not 2.5.x as you are currently using).

FabioPedretti commented 3 years ago

If you have a huge server with many many cached files, it may require tens of seconds for the gui to fully load. Maybe the page may also timeout and stop updating leaving the image you posted.

amnuts commented 3 years ago

What version are you running @FabioPedretti? I tried it locally with 60K+ files and it was snappy to respond. What version are you using? 2.x was slow to do that but 3.x is far more responsive.

FabioPedretti commented 3 years ago

Indeed I am running 2.5.4, since 3.x is not compatible with PHP 7.0.

amnuts commented 3 years ago

If upgrading to new, and not EOL PHP versions is out of the question, then it shouldn't be too hard for you to use version 3 and then make it backwards compatible for your own needs. From a quick look through, I think that there are only a few lines you'd need to adjust for PHP 7.0:

public function getOption(?string $name = null)

public function getData(?string $section = null, ?string $property = null)

public function resetCache(?string $file = null): bool

It'll just be a case of getting rid of the ? for each of the params.

FabioPedretti commented 3 years ago

I can confirm your suggested fix makes 3.2.0 working also on PHP 7.0. And indeed it's a lot faster to load than 2.5.4! Also it doesn't have the 2.5.4 behavior to only shows part of the page before fully loading.

(Maybe fixing the code to also supports PHP 7.0, or at least printing an error in the web page that PHP 7.1 (it looks like a new 7.1 feature) is required or adding it in the doc could be useful to others)

amnuts commented 3 years ago

Glad that worked @FabioPedretti!

I'm not really tempted to downgrade the code (even if it's only a few lines) because that's kind of supporting people using a much older version of PHP than really should be used. And shouldn't we all as developers try to improve what's out there where we can? :-) I really do appreciate, though, that sometimes developers just don't have the ability to change the version of PHP they use because it's out of their control.

The PHP version restriction is in the composer.json file but I take your point about adding it to the documentation, so I will add it there soon.

But I feel like this has deviated enough from @snack753's original issue. So if you have any more feedback, please feel free to create a new issue!