You are here

interface DrupalMemcachedInterface in Memcache Storage 8

Hierarchy

Expanded class hierarchy of DrupalMemcachedInterface

All classes that implement DrupalMemcachedInterface

File

src/DrupalMemcachedInterface.php, line 5

Namespace

Drupal\memcache_storage
View source
interface DrupalMemcachedInterface {

  /**
   * Builds a new DrupalMemcache(d) object.
   *
   * @param array $settings
   *   Array of Settings:get('memcache_storage') settings.
   *
   * @param $cluster_name
   *   Name of the memcached cluster.
   *   Default name is 'default'.
   */
  public function __construct(array $settings, $cluster_name);

  /**
   * @param $servers
   *   List of services related to the current cluster.
   *
   * @return bool
   *   Connection status.
   */
  public function addServers($servers);

  /**
   * Adds a new memcached server.
   *
   * @param $host
   *   Memcached host name.
   *   For example:
   *   - 127.0.0.1
   *   - /path/to/memcached.socket.
   *
   * @param $port
   *   Port for memcached host.
   *   Always 0 for unix sockets.
   */
  public function addServer($host, $port);

  /**
   * Returns info about connected memached servers.
   *
   * @return array
   *   Info about connected memached servers.
   */
  public function getStats();

  /**
   * Set the cache to the memcached.
   *
   * @param $key
   *   Cache key string.
   *
   * @param $value
   *   Cache value.
   *
   * @param int $expiration
   *   Timestamp of cache expiration date.
   *   If cache is permanent - then the value is 0.
   *
   * @param string $cache_bin
   *   Name of the cache bin.
   */
  public function set($key, $value, $expiration = 0, $cache_bin = '');

  /**
   * Bulk set if cache items to the memcached pool.
   *
   * @param array $items
   *   List of cache items.
   *
   * @param string $cache_bin
   *   Name of the cache bin.
   */
  public function setMulti(array $items, $cache_bin = '');

  /**
   * Get the cache item from memcached.
   *
   * @param $key
   *   Cache item key string.
   *
   * @param string $cache_bin
   *   Name of the cache bin.
   *
   * @return mixed
   *   Cache data or empty, if not found.
   */
  public function get($key, $cache_bin = '');

  /**
   * Get the multiple cache items from the memcached pool.
   *
   * @param array $keys
   *   List of cache keys to receive.
   *
   * @param string $cache_bin
   *   Name of the cache bin.
   *
   * @return array
   *   List of cached data with cache keys as array keys.
   */
  public function getMulti(array $keys, $cache_bin = '');

  /**
   * Delete the cache item from memcached.
   *
   * @param $key
   *   Cache item key string.
   *
   * @param string $cache_bin
   *   Name of the cache bin.
   */
  public function delete($key, $cache_bin = '');

  /**
   * Bulk delete from the memcached pool.
   *
   * @param array $keys
   *   List of cache keys to delete.
   *
   * @param string $cache_bin
   *   Name of the cache bin.
   */
  public function deleteMulti(array $keys, $cache_bin = '');

  /**
   * Reset the cache for the entire cache bin.
   *
   * @param string $cache_bin
   *   Name of the cache bin.
   */
  public function flush($cache_bin = '');

}

Members

Namesort descending Modifiers Type Description Overrides
DrupalMemcachedInterface::addServer public function Adds a new memcached server. 2
DrupalMemcachedInterface::addServers public function 1
DrupalMemcachedInterface::delete public function Delete the cache item from memcached. 1
DrupalMemcachedInterface::deleteMulti public function Bulk delete from the memcached pool. 2
DrupalMemcachedInterface::flush public function Reset the cache for the entire cache bin. 1
DrupalMemcachedInterface::get public function Get the cache item from memcached. 1
DrupalMemcachedInterface::getMulti public function Get the multiple cache items from the memcached pool. 2
DrupalMemcachedInterface::getStats public function Returns info about connected memached servers. 2
DrupalMemcachedInterface::set public function Set the cache to the memcached. 1
DrupalMemcachedInterface::setMulti public function Bulk set if cache items to the memcached pool. 2
DrupalMemcachedInterface::__construct public function Builds a new DrupalMemcache(d) object. 1