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

fixes error when opcache is disabled #23

Merged
merged 1 commit into from Jul 26, 2014

Conversation

Projects
None yet
3 participants
@amenadiel

amenadiel commented Jul 26, 2014

If you load the gui panel with opcache disabled in php.ini, you get an error

Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (@time()) at position 0 (@): Unexpected character' in /var/www/opcache/src/OpCacheGUI/OpCache/Status.php:141 Stack trace: #0 /var/www/opcache/src/OpCacheGUI/OpCache/Status.php(141): DateTime->__construct('@time()') #1 /var/www/opcache/template/status.phtml(39): OpCacheGUI\OpCache\Status->getStatsInfo() #2 /var/www/opcache/bootstrap.php(95): require('/var/www/opcach...') #3 /var/www/opcache/public/index.php(3): require('/var/www/opcach...') #4 {main} thrown in /var/www/opcache/src/OpCacheGUI/OpCache/Status.php on line 141

So I added a verification to the getStatsInfo method to fallback to empty stats, displaying the following:

rsz_screenshot_from_2014-07-26_134203

@PeeHaa

This comment has been minimized.

Show comment
Hide comment
@PeeHaa

PeeHaa Jul 26, 2014

Owner

I love how downvoting your answer on Stack Overflow ended up in a PR :-)

Owner

PeeHaa commented Jul 26, 2014

I love how downvoting your answer on Stack Overflow ended up in a PR :-)

PeeHaa added a commit that referenced this pull request Jul 26, 2014

Merge pull request #23 from amenadiel/master
fixes error when opcache is disabled

@PeeHaa PeeHaa merged commit fc4a7cc into PeeHaa:master Jul 26, 2014

@amenadiel

This comment has been minimized.

Show comment
Hide comment
@amenadiel

amenadiel Jul 26, 2014

Lol

I looked at your profile on S.O. thinking "who's this guy and why does he hate me... oh wait, I'm using opcacheGUI since last week. I never sent this PR". Small world.

amenadiel commented Jul 26, 2014

Lol

I looked at your profile on S.O. thinking "who's this guy and why does he hate me... oh wait, I'm using opcacheGUI since last week. I never sent this PR". Small world.

@maciejczyzewski

This comment has been minimized.

Show comment
Hide comment
@maciejczyzewski

maciejczyzewski Jul 26, 2014

Two Smoking Barrels?

maciejczyzewski commented Jul 26, 2014

Two Smoking Barrels?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment