Lock.php in Redis 7
File
lib/Redis/Lock.php
View source
<?php
class Redis_Lock {
private static $__instance;
public static function setBackend(Redis_Lock_Backend_Interface $lockBackend) {
if (isset(self::$__instance)) {
throw new Exception("Lock backend already set, changing it would cause already acquired locks to stall.");
}
self::$__instance = $lockBackend;
}
public static function getBackend() {
if (!isset(self::$__instance)) {
throw new Exception("No lock backend set.");
}
return self::$__instance;
}
}