Releases a lock.

@param mixed $key The key of the lock.
@throws \Exception
519005
static public function release($key)
    {
        $keyMD5 = md5(self::$keyPrefix . serialize($key));
        if (!isset(self::$data[$keyMD5])) {
            throw new \Exception('A lock name "' . $key . '" does not exists in current process!');
        }
        $dir = self::getLocksDir();
        if (!is_dir($dir)) {
            return;
        }
        set_error_handler(function($errno, $errstr) {
            throw new \Exception($errstr);
        });
        try {
            if (flock(self::$data[$keyMD5], LOCK_UN) && fclose(self::$data[$keyMD5])) {
                try {
                    $filename = $dir . $keyMD5 . '.lock';
                    $tempFilename = $filename . '.' . md5(uniqid() . rand(0, 999999));
                    $renameResult = rename($filename, $tempFilename);
                    if ($renameResult) {
                        unlink($tempFilename);
                    }
                } catch (\Exception $e) {
                    // Don't care whether the rename is successful
                }
                unset(self::$data[$keyMD5]);
                restore_error_handler();
                return;
            }
        } catch (\Exception $e) {
            restore_error_handler();
            throw new \Exception('Cannot release the lock named "' . $key . '". Reason: ' . $e->getMessage());
        }
        restore_error_handler();
        throw new \Exception('Cannot release the lock named "' . $key . '"');
    }
1075250
public function remove($key)
    {
        if ($key == 'message') {
            $this->message = '';
        }

        if ($key == 'exception') {
            $this->exception = null;
        }

        if (array_key_exists($key, $this->payload)) {
            unset($this->payload[$key]);
        }
    }
379814
public function remove($key)
    {
        if ($this->resumable() && $this->started()) {
            $unset = &$_SESSION;
            foreach (func_get_args() as $key) {
                $names = $this->explode($key);
                while (count($names) > 1) {
                    $name = array_shift($names);
                    if (isset($_SESSION[$name]) && is_array($_SESSION[$name])) {
                        $_SESSION = &$_SESSION[$name];
                    }
                }
                unset($_SESSION[array_shift($names)]);
                $_SESSION = &$unset; // clean up after each pass
            }
        }
    }
409336
public static function delete( $key ) {

		if ( isset( self::$config[ strtolower( $key ) ] ) ) {
			unset( self::$config[ strtolower( $key ) ] );
		}

	}
285697
private function evictFromCacheByKey($key)
    {
        if ( ! $this->cache->contains($key)) {
            return;
        }

        $this->cache->delete($key);
    }
758154
protected function release($key, $id)
    {
        $this->redis->eval($this->releaseScript(), 1, $key, $id);
    }
877002
public static function unlock($key) {
        /* @var $cache RedisCache */
        $cache = Pool::get(CacheInterface::class);
        try {
            $ok = false;
            if ($cache instanceof RedisCache) {
                $cache->open();
                $redis = $cache->redis;
                $script = "local v = redis.call('get', KEYS[1]) if(v==false) then return 1 end if ( v== 
            ARGV[1]) then 
            return redis.call('del', KEYS[1]) end if(string.find (v, 'lock_')==1) then return 0 end   
            v=tonumber(v)  v=v-1 if(v==0) then return redis.call('del', KEYS[1]) else return redis.call('set',KEYS[1],v) end";
                $ok = $redis->eval($script, ["_RedisLocker_$key", 'lock_' . Context::id()], 1);
                $ok = $ok ? true : false;
            }
            Pool::release($cache);
        } catch (\RuntimeException $e) {
            Pool::release($cache);
            throw $e;
        } catch (\Error $e) {
            Pool::release($cache);
            throw $e;
        }
        return $ok;
    }
1226399
public function releaseLock( $key )
    {
        if ( strlen( $key ) > self::MAX_KEY_LENGTH )
        {
            throw new ezcCacheInvalidKeyException( $key, 'Length > ' . self::MAX_KEY_LENGTH . '.' );
        }

        $this->memcache->delete( $key );
    }
1199810
public function lock($key, $timeout = self::EXPIRE): bool
    {
        $wait = 20000;
        $totalWait = 0;
        $time = $timeout * 1000000;
        $key = self::PREFIX . $key;

        while ($totalWait < $time && false === $this->mem->add($key, 1, $timeout)) {
            usleep($wait);
            $totalWait += $wait;
        }

        if ($totalWait >= $time) {
            throw new \RuntimeException('cannot get lock for waiting ' . $timeout . 's.', __LINE__);
        }

        return true;
    }
950207
public function release_lock($key) {
        $key = $this->parse_key($key);
        if ($this->nativelocking) {
            return $this->get_store()->release_lock($key, $this->get_identifier());
        } else {
            $this->ensure_cachelock_available();
            return $this->cachelockinstance->unlock($key, $this->get_identifier());
        }
    }
877917
public function offsetUnset( $key )
	{
		if( !isset( $this->____pairs ) )
			$this->getPairs();
		if( !array_key_exists( $key, $this->____pairs ) )
			throw new Exception( 'Pair Key "'.$key.'" is not set in Row.' );
		unset( $this->____pairs[$key] );
	}
298133
protected function lock(string $key)
    {
        if (isset($this->locks[$key])) {
            throw new InvalidArgumentError('Key was already locked.');
        }

        $this->locks[$key] = new Delayed();
    }
1126404
public function remove($key)
    {
        if ($this->resumeSession()) {
            if (isset($_SESSION) && array_key_exists($key, $_SESSION)) {
                unset($_SESSION[$key]);
            }
        }
    }
333609
public function remove($key)
    {
        if (! $this->enabled) {
            return;
        }
        $file = $this->getPath($key);
        if (! file_exists($file)) {
            return true;
        }

        set_error_handler(function () {
            throw new Exception('An error occurred.');
        }, E_WARNING);

        try {
            unlink($file);
        } catch (Exception $ex) {
            restore_error_handler();

            return false;
        }
        restore_error_handler();

        return true;
    }
1342735
public function unlock($key)
    {
        
        $this->logger->info("[Filesystem cache] Unlock '$key'");

        $lockFile = $this->fixKey($key) . ".lock";

        if (file_exists($lockFile)) {
            unlink($lockFile);
        }
    }
904103
public function remove($key)
    {
        $keys = explode('.', $key);
        $section = &$this->items;

        while (count($keys) > 1) {
            $key = array_shift($keys);

            if (! isset($section[$key])) {
                return;
            }

            $section = &$section[$key];
        }

        unset($section[array_shift($keys)]);

        $this->notify();
    }
451968
public function forget($key)
    {
        if (
            isset($_SESSION[$this->config['key']]) &&
            isset($_SESSION[$this->config['key']][$key])
        ) {
            unset($_SESSION[$this->config['key']][$key]);
        }

        if (isset($this->flash[$key])) {
            unset($this->flash[$key]);
        }
    }