You are here

public static function DrupalMemcachedUtils::getPeclExtension in Memcache Storage 8

Returns the name of PECL extension to use.

4 calls to DrupalMemcachedUtils::getPeclExtension()
DrupalMemcachedFactory::__construct in src/DrupalMemcachedFactory.php
Constructs the factory object.
DrupalMemcachedUtils::parseServerInfo in src/DrupalMemcachedUtils.php
Parses the string of memcached server.
MemcachedStatistics::content in src/Controller/MemcachedStatistics.php
memcache_storage_requirements in ./memcache_storage.install
Implements hook_requirements().

File

src/DrupalMemcachedUtils.php, line 42

Class

DrupalMemcachedUtils

Namespace

Drupal\memcache_storage

Code

public static function getPeclExtension() {
  $settings = Settings::get('memcache_storage');
  if (!empty($settings['extension'])) {
    $extension = $settings['extension'];
  }
  elseif (class_exists('Memcached')) {
    $extension = 'Memcached';
  }
  elseif (class_exists('Memcache')) {
    $extension = 'Memcache';
  }
  return !empty($extension) ? $extension : FALSE;
}