Skip to content

Use setTimestamp to prevent DateTimer parse exceptions - #14

Closed
OndraM wants to merge 1 commit into
PeeHaa:masterfrom
OndraM:fix-datetime
Closed

Use setTimestamp to prevent DateTimer parse exceptions#14
OndraM wants to merge 1 commit into
PeeHaa:masterfrom
OndraM:fix-datetime

Conversation

@OndraM

@OndraM OndraM commented Feb 20, 2014

Copy link
Copy Markdown

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

PeeHaa commented Nov 1, 2014

Copy link
Copy Markdown
Owner

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.

2 participants