class FloodFactory in Redis 8
Flood backend singleton handling.
Hierarchy
- class \Drupal\redis\Flood\FloodFactory
Expanded class hierarchy of FloodFactory
1 string reference to 'FloodFactory'
1 service uses FloodFactory
File
- src/
Flood/ FloodFactory.php, line 11
Namespace
Drupal\redis\FloodView source
class FloodFactory {
/**
* @var \Drupal\redis\ClientInterface
*/
protected $clientFactory;
/**
* The request stack.
*
* @var \Symfony\Component\HttpFoundation\RequestStack
*/
protected $requestStack;
/**
* Construct the PhpRedis flood backend factory.
*
* @param \Drupal\redis\ClientFactory $client_factory
* The database connection which will be used to store the flood event
* information.
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* The request stack used to retrieve the current request.
*/
public function __construct(ClientFactory $client_factory, RequestStack $request_stack) {
$this->clientFactory = $client_factory;
$this->requestStack = $request_stack;
}
/**
* Get actual flood backend.
*
* @return \Drupal\Core\Flood\FloodInterface
* Return flood instance.
*/
public function get() {
$class_name = $this->clientFactory
->getClass(ClientFactory::REDIS_IMPL_FLOOD);
return new $class_name($this->clientFactory, $this->requestStack);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FloodFactory:: |
protected | property | ||
FloodFactory:: |
protected | property | The request stack. | |
FloodFactory:: |
public | function | Get actual flood backend. | |
FloodFactory:: |
public | function | Construct the PhpRedis flood backend factory. |