You are here

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

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

Cron constructor. Getting tasks option.

File

src/lib/Cleantalk/Common/Cron.php, line 36

Class

Cron
CleanTalk Cron class

Namespace

Cleantalk\Common

Code

public function __construct($cron_option_name = 'cleantalk_cron', $task_execution_min_interval = 120, $cron_execution_min_interval = 600) {

  /*
   * @todo perform this logic
  // Assign properties from the given parameters if exists
  // Notice that if $this->$param_name is NULL new value won't be set
  foreach( $params as $param_name => $param ){
      $this->$param_name = isset( $this->$param_name ) ? $param : null;
  }
  */
  $this->cron_option_name = $cron_option_name;
  $this->task_execution_min_interval = $task_execution_min_interval;
  $this->cron_execution_min_interval = $cron_execution_min_interval;
  if (time() - $this
    ->getCronLastStart() > $this->cron_execution_min_interval) {
    $this->tasks = $this
      ->getTasks();
  }
}