You are here

Lock.php in Redis 7.2

Same filename and directory in other branches
  1. 7.3 lib/Redis/Lock.php
  2. 7 lib/Redis/Lock.php

File

lib/Redis/Lock.php
View source
<?php

/**
 * Lock backend singleton handling.
 */
class Redis_Lock {

  /**
   * @var Redis_Lock_Backend_Interface
   */
  private static $instance;

  /**
   * Get actual lock backend.
   *
   * @return Redis_Lock_Backend_Interface
   */
  public static function getBackend() {
    if (!isset(self::$instance)) {
      $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_LOCK);
      self::$instance = new $className();
    }
    return self::$instance;
  }

}

Classes

Namesort descending Description
Redis_Lock Lock backend singleton handling.