You are here

function _cleantalk_set_ws in Anti Spam by CleanTalk 8

Same name and namespace in other branches
  1. 7 cleantalk.module \_cleantalk_set_ws()
  2. 7.2 cleantalk.module \_cleantalk_set_ws()

Cleantalk inner function - sets working server.

1 call to _cleantalk_set_ws()
_cleantalk_check_spam in ./cleantalk.module
Cleantalk inner function - performs antispam checking.

File

./cleantalk.module, line 640
Main CleanTalk integration module functions.

Code

function _cleantalk_set_ws($work_url = 'http://moderate.cleantalk.ru', $server_url = 'http://moderate.cleantalk.ru', $server_ttl = 0, $server_changed = 0) {
  \Drupal::configFactory()
    ->getEditable('cleantalk.settings')
    ->set('cleantalk_work_url', $work_url)
    ->save();
  \Drupal::configFactory()
    ->getEditable('cleantalk.settings')
    ->set('cleantalk_server_url', $server_url)
    ->save();
  \Drupal::configFactory()
    ->getEditable('cleantalk.settings')
    ->set('cleantalk_server_ttl', $server_ttl)
    ->save();
  \Drupal::configFactory()
    ->getEditable('cleantalk.settings')
    ->set('cleantalk_server_changed', $server_changed)
    ->save();
}