diff --git a/memcache_admin/src/Controller/MemcacheStatisticsController.php b/memcache_admin/src/Controller/MemcacheStatisticsController.php index f5044c2..4c894ff 100644 --- a/memcache_admin/src/Controller/MemcacheStatisticsController.php +++ b/memcache_admin/src/Controller/MemcacheStatisticsController.php @@ -90,7 +90,7 @@ class MemcacheStatisticsController extends ControllerBase { $data['server_overview'][$server] = t('v@version running @uptime', ['@version' => $statistics['version'], '@uptime' => \Drupal::service('date.formatter')->formatInterval($statistics['uptime'])]); $data['server_pecl'][$server] = t('n/a'); - $data['server_time'][$server] = format_date($statistics['time']); + $data['server_time'][$server] = \Drupal::service('date.formatter')->format($statistics['time']); $data['server_connections'][$server] = $this->stats_connections($statistics); $data['cache_sets'][$server] = $this->stats_sets($statistics); $data['cache_gets'][$server] = $this->stats_gets($statistics); @@ -522,7 +522,7 @@ class MemcacheStatisticsController extends ControllerBase { $v = $this->t('infinite'); } else { - $v = $this->t('in @time', ['@time' => format_interval($v - REQUEST_TIME)]); + $v = $this->t('in @time', ['@time' => format_interval($v - \Drupal::time()->getRequestTime())]); } } $k = new HtmlEscapedText($k); diff --git a/src/MemcacheBackend.php b/src/MemcacheBackend.php index da923ed..13192c4 100644 --- a/src/MemcacheBackend.php +++ b/src/MemcacheBackend.php @@ -120,7 +120,7 @@ class MemcacheBackend implements CacheBackendInterface { $cache->valid = TRUE; // Items that have expired are invalid. - if ($cache->expire != CacheBackendInterface::CACHE_PERMANENT && $cache->expire <= REQUEST_TIME) { + if ($cache->expire != CacheBackendInterface::CACHE_PERMANENT && $cache->expire <= \Drupal::time()->getRequestTime()) { $cache->valid = FALSE; } @@ -217,7 +217,7 @@ class MemcacheBackend implements CacheBackendInterface { public function invalidateMultiple(array $cids) { foreach ($cids as $cid) { if ($item = $this->get($cid)) { - $item->expire = REQUEST_TIME - 1; + $item->expire = \Drupal::time()->getRequestTime() - 1; $this->memcache->set($cid, $item); } }