You are here

private function MemcacheStatisticsController::binMapping in Memcache API and Integration 8.2

Helper function, reverse map the memcache_bins variable.

1 call to MemcacheStatisticsController::binMapping()
MemcacheStatisticsController::statsTableRaw in memcache_admin/src/Controller/MemcacheStatisticsController.php
Callback for the Memcache Stats page.

File

memcache_admin/src/Controller/MemcacheStatisticsController.php, line 117

Class

MemcacheStatisticsController
Memcache Statistics.

Namespace

Drupal\memcache_admin\Controller

Code

private function binMapping($bin = 'cache') {
  $memcache = \Drupal::service('memcache.factory')
    ->get(NULL, TRUE);
  $memcache_bins = $memcache
    ->getBins();
  $bins = array_flip($memcache_bins);
  if (isset($bins[$bin])) {
    return $bins[$bin];
  }
  else {
    return $this
      ->defaultBin($bin);
  }
}