/** * Constructor. * * @param array $config Settings for the filter. * @throws \Cake\Core\Exception\Exception When 'when' conditions are not callable. */ public function __construct($config = []) { parent::__construct($config); if (!empty($config['locales'])) { $this->_locales = $config['locales']; } }
/** * * Constructor. * * @param array $config Array of config. */ public function __construct($config = []) { if (!empty($config['cacheTime'])) { $this->_cacheTime = $config['cacheTime']; } parent::__construct($config); }
/** * Class constructor. * * @param array $config Configuration options */ public function __construct($config = []) { $config += ['priority' => 1, 'message' => 'Rate limit exceeded', 'interval' => '+1 minute', 'limit' => 10, 'identifier' => function (Request $request) { return $request->clientIp(); }, 'headers' => ['limit' => 'X-RateLimit-Limit', 'remaining' => 'X-RateLimit-Remaining', 'reset' => 'X-RateLimit-Reset']]; parent::__construct($config); }
public function __construct($config = []) { $defaults = ['validToken' => null, 'cookieName' => '__cakephp_test_connection']; if (is_string($config)) { $config = ['validToken' => $config]; } parent::__construct(array_merge($defaults, $config)); }
public function __construct($config = []) { $config += ['priority' => 1, 'message' => 'Rate limit exceeded', 'interval' => '1 minute', 'rate' => 10, 'identifier' => function (Request $request) { return $request->clientIp(); }]; parent::__construct($config); $this->config('when', [$this, 'when']); $this->_initCache(); }
public function __construct($config = []) { $config += ['key' => 'APP_ENV', 'value' => 'production']; if (empty($config['when'])) { $config['when'] = function () use($config) { return $request->env($config['key']) === $config['value']; }; } parent::__construct($config); }
public function __construct($config = []) { $config += ['priority' => 1, 'path' => ROOT . DS . 'maintenance.html']; if (empty($config['when'])) { $config['when'] = function () use($config) { return file_exists($config['path']); }; } parent::__construct($config); }
/** * constructor * * @param array $config configuration */ public function __construct($config = []) { parent::__construct($config); if (!empty($config['classes'])) { $this->_classes = $config['classes']; if (!is_array($this->_classes)) { $this->_classes = [$this->_classes]; } } }
public function __construct($config = []) { $config += ['message' => 'Forbidden (%s)', 'allow' => [], 'disallow' => []]; if (empty($config['when'])) { $config['when'] = function (Request $request) use($config) { $ip = $request->clientIp(); return !(in_array($ip, $config['allow']) || !in_array($ip, $config['disallow'])); }; } parent::__construct($config); }
public function __construct($config = []) { parent::__construct($config); }
/** * Constructor * * @param \Cake\Event\EventManager $events The event manager to use. * @param array $config The configuration data for DebugKit. */ public function __construct(EventManager $events, array $config) { parent::__construct($config); $this->eventManager($events); $this->_registry = new PanelRegistry($events); }
/** * Constructor. * * @param array $config Settings for the filter. * @throws \InvalidArgumentException When 'when' conditions are not callable. */ public function __construct($config = []) { $this->_defaultConfig = $this->_defaultConfigExt + $this->_defaultConfig; parent::__construct($config); }
/** * construct * * @param array $config */ public function __construct($config = []) { $this->Visitors = TableRegistry::get('Analyzer.Visitors'); $this->Requests = TableRegistry::get('Analyzer.Requests'); parent::__construct($config); }