You are here

public function RateLimitGlobal::__construct in RESTful 7.2

Overrides RateLimit::__construct

File

src/Plugin/rate_limit/RateLimitGlobal.php, line 27
Contains \Drupal\restful\Plugin\rate_limit\RateLimitGlobal

Class

RateLimitGlobal
Class RateLimitGlobal @package Drupal\restful\Plugin\rate_limit

Namespace

Drupal\restful\Plugin\rate_limit

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $limit = variable_get('restful_global_rate_limit', 0);
  foreach (user_roles() as $rid => $role_info) {
    $this->limits[$rid] = $limit;
  }
  $this->period = new \DateInterval(variable_get('restful_global_rate_period', 'P1D'));
}