Skip to content

Commit

Permalink
Merge pull request #351 from Geolim4/final
Browse files Browse the repository at this point in the history
Fixed notice on Memcache driver when the server just started
  • Loading branch information
Geolim4 authored Aug 21, 2016
2 parents c32d937 + d1cabb8 commit 51d756f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/phpFastCache/Drivers/Memcache/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ protected function driverConnect()
public function getStats()
{
$stats = (array) $this->instance->getstats();
$stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0);
$stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : 'UnknownVersion');
$stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0);

$date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);

return (new driverStatistic())
Expand Down
4 changes: 4 additions & 0 deletions src/phpFastCache/Drivers/Memcached/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ protected function driverConnect()
public function getStats()
{
$stats = (array) $this->instance->getStats();
$stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0);
$stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : 'UnknownVersion');
$stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0);

$date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);

return (new driverStatistic())
Expand Down

0 comments on commit 51d756f

Please sign in to comment.