function MemoryBackend::register
Same name in other branches
- 9 core/lib/Drupal/Core/Flood/MemoryBackend.php \Drupal\Core\Flood\MemoryBackend::register()
- 10 core/lib/Drupal/Core/Flood/MemoryBackend.php \Drupal\Core\Flood\MemoryBackend::register()
- 11.x core/lib/Drupal/Core/Flood/MemoryBackend.php \Drupal\Core\Flood\MemoryBackend::register()
Overrides FloodInterface::register
File
-
core/
lib/ Drupal/ Core/ Flood/ MemoryBackend.php, line 37
Class
- MemoryBackend
- Defines the memory flood backend. This is used for testing.
Namespace
Drupal\Core\FloodCode
public function register($name, $window = 3600, $identifier = NULL) {
if (!isset($identifier)) {
$identifier = $this->requestStack
->getCurrentRequest()
->getClientIp();
}
// We can't use REQUEST_TIME here, because that would not guarantee
// uniqueness.
$time = microtime(TRUE);
$this->events[$name][$identifier][$time + $window] = $time;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.