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

OpCache guy does only show #65

Open
snack753 opened this issue Dec 9, 2020 · 8 comments
Open

OpCache guy does only show #65

snack753 opened this issue Dec 9, 2020 · 8 comments

Comments

@snack753
Copy link

snack753 commented Dec 9, 2020

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
Copy link

abias commented Dec 9, 2020

@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
Copy link
Owner

amnuts commented Dec 9, 2020

@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
Copy link

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
Copy link
Owner

amnuts commented Dec 14, 2020

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
Copy link

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

@amnuts
Copy link
Owner

amnuts commented Dec 14, 2020

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
Copy link

FabioPedretti commented Dec 15, 2020

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
Copy link
Owner

amnuts commented Dec 16, 2020

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!

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

4 participants