You are here

public function AntiFlood::__construct in Anti Spam by CleanTalk 8.4

Same name and namespace in other branches
  1. 9.1.x src/lib/Cleantalk/Common/Firewall/Modules/AntiFlood.php \Cleantalk\Common\Firewall\Modules\AntiFlood::__construct()

* FirewallModule constructor. * Use this method to prepare any data for the module working. * *

Parameters

string $data_table: * @param array $params

Overrides FirewallModule::__construct

File

src/lib/Cleantalk/Common/Firewall/Modules/AntiFlood.php, line 42

Class

AntiFlood

Namespace

Cleantalk\Common\Firewall\Modules

Code

public function __construct($log_table, $params = array()) {
  $db = DB::getInstance();
  $this->db__table__logs = $db->prefix . $log_table ?: null;
  $this->db__table__ac_logs = $params['db__table__ac_logs'] ? $db->prefix . $params['db__table__ac_logs'] : null;
  $this->db__table__ac_ua_bl = defined('APBCT_TBL_AC_UA_BL') ? $db->prefix . APBCT_TBL_AC_UA_BL : null;
  $this->sign = md5(Server::get('HTTP_USER_AGENT') . Server::get('HTTPS') . Server::get('HTTP_HOST'));
  $this->view_limit = $params['view_limit'] ?: null;
}