You are here

public function RestfulRateLimitGlobal::__construct in RESTful 7

Constructor.

Parameters

array $plugin_info: Plugin definition sub-array.

\RestfulEntityBase $resource: The resource this object is limiting access to.

Overrides RestfulRateLimitBase::__construct

File

plugins/rate_limit/RestfulRateLimitGlobal.class.php, line 13
Contains RestfulRateLimitGlobal

Class

RestfulRateLimitGlobal
@file Contains RestfulRateLimitGlobal

Code

public function __construct(array $plugin_info, $resource = NULL) {
  parent::__construct($plugin_info, $resource);
  $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'));
}