You are here

class AcquiaPurgeStateStorageMemcache in Acquia Purge 7

Memcached backed state storage.

Hierarchy

Expanded class hierarchy of AcquiaPurgeStateStorageMemcache

File

lib/state/AcquiaPurgeStateStorageMemcache.php, line 11
Contains AcquiaPurgeStateStorageMemcache.

View source
class AcquiaPurgeStateStorageMemcache extends AcquiaPurgeStateStorageBase {

  /**
   * Memcached key used to store our state data in.
   *
   * @var string
   */
  protected $key;

  /**
   * Memcached bin used to store our state data in memcached.
   *
   * @var string
   */
  protected $bin;

  /**
   * Construct AcquiaPurgeStateStorageMemcache.
   *
   * @param string $key
   *   Memcached key used to store our state data in.
   * @param string $bin
   *   Memcached bin used to store our state data in memcached.
   */
  public function __construct($key, $bin) {
    $this->key = $key;
    $this->bin = $bin;
    parent::__construct(dmemcache_get($this->key, $this->bin));
  }

  /**
   * {@inheritdoc}
   */
  public function commit() {
    if (!$this->commit) {
      return;
    }
    else {
      $this->commit = FALSE;
    }
    dmemcache_set($this->key, $this->buffer, 0, $this->bin);
  }

  /**
   * {@inheritdoc}
   */
  public function wipe() {
    parent::wipe();
    dmemcache_delete($this->key, $this->bin);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AcquiaPurgeStateStorageBase::$buffer protected property The payload buffer which gets synchronized with memcached.
AcquiaPurgeStateStorageBase::$commit protected property Indicates if ::commit() has been registered to be called at shutdown.
AcquiaPurgeStateStorageBase::$items protected property Item instances.
AcquiaPurgeStateStorageBase::get public function Retrieve the object named $key. Overrides AcquiaPurgeStateStorageInterface::get
AcquiaPurgeStateStorageBase::getCounter public function Retrieve a counter object named $key. Overrides AcquiaPurgeStateStorageInterface::getCounter
AcquiaPurgeStateStorageBase::set public function Store the state item in state item storage. Overrides AcquiaPurgeStateStorageInterface::set
AcquiaPurgeStateStorageMemcache::$bin protected property Memcached bin used to store our state data in memcached.
AcquiaPurgeStateStorageMemcache::$key protected property Memcached key used to store our state data in.
AcquiaPurgeStateStorageMemcache::commit public function Commit the state data to its persistent storage location. Overrides AcquiaPurgeStateStorageInterface::commit
AcquiaPurgeStateStorageMemcache::wipe public function Wipe all state data. Overrides AcquiaPurgeStateStorageBase::wipe
AcquiaPurgeStateStorageMemcache::__construct public function Construct AcquiaPurgeStateStorageMemcache. Overrides AcquiaPurgeStateStorageBase::__construct