You are here

public function Predis::clear in Redis 8

Makes the flood control mechanism forget an event for the current visitor.

Parameters

string $name: The name of an event.

string $identifier: (optional) Unique identifier of the current user. Defaults to the current user's IP address).

Overrides FloodInterface::clear

File

src/Flood/Predis.php, line 64

Class

Predis
Defines the database flood backend. This is the default Drupal backend.

Namespace

Drupal\redis\Flood

Code

public function clear($name, $identifier = NULL) {
  if (!isset($identifier)) {
    $identifier = $this->requestStack
      ->getCurrentRequest()
      ->getClientIp();
  }
  $key = $this
    ->getPrefix() . ':flood:' . $name . ':' . $identifier;
  $this->client
    ->del($key);
}