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

Use setTimestamp to prevent DateTimer parse exceptions #14

Closed
wants to merge 1 commit into from
Closed

Use setTimestamp to prevent DateTimer parse exceptions #14

wants to merge 1 commit into from

Conversation

OndraM
Copy link

@OndraM OndraM commented Feb 20, 2014

On PHP 5.5.9 exception is thrown:

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

This PR fixes at and makes the DateTime being created from timestamp in a PHP 5.3+ way.

@PeeHaa
Copy link
Owner

PeeHaa commented Nov 1, 2014

I'm fairly certain the issue was not the way the instance was created, but rather the fact that the timestamp was not set.

There have been several iterations at that part of the code and I am pretty sure this issue is fixed now.

If you are still having this issue let me know and I will investigate more.

@PeeHaa PeeHaa closed this Nov 1, 2014
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

Successfully merging this pull request may close these issues.

None yet

2 participants