Helper.php in Anti Spam by CleanTalk 9.1.x
File
src/lib/Cleantalk/ApbctDrupal/Helper.php
View source
<?php
namespace Cleantalk\ApbctDrupal;
class Helper extends \Cleantalk\Common\Helper {
public static function getFwStats() {
return array(
'firewall_updating_id' => \Drupal::state()
->get('firewall_updating_id') ? \Drupal::state()
->get('firewall_updating_id') : null,
'firewall_updating_last_start' => \Drupal::state()
->get('firewall_updating_last_start') ? \Drupal::state()
->get('firewall_updating_last_start') : 0,
'firewall_update_percent' => \Drupal::state()
->get('firewall_update_percent') ? \Drupal::state()
->get('firewall_update_percent') : null,
);
}
public static function setFwStats($fw_stats) {
\Drupal::state()
->set('firewall_updating_id', isset($fw_stats['firewall_updating_id']) ? $fw_stats['firewall_updating_id'] : null);
\Drupal::state()
->set('firewall_updating_last_start', isset($fw_stats['firewall_updating_last_start']) ? $fw_stats['firewall_updating_last_start'] : 0);
\Drupal::state()
->set('firewall_update_percent', isset($fw_stats['firewall_update_percent']) ? $fw_stats['firewall_update_percent'] : 0);
}
public static function SfwUpdate_DoFinisnAction() {
\Drupal::state()
->set('cleantalk_sfw_last_check', time());
}
}