Skip to content

Commit

Permalink
Resolves #585
Browse files Browse the repository at this point in the history
  • Loading branch information
Daiyrbek Artelov committed May 15, 2018
1 parent e76a757 commit 59addca
Show file tree
Hide file tree
Showing 2 changed files with 530 additions and 0 deletions.
12 changes: 12 additions & 0 deletions includes/classes/ia.core.cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class iaCron extends abstractCore
protected static $_table = 'cron';


public function init()
{
parent::init();
require_once IA_INCLUDES . 'utils/Cron.php';
}

/**
* Execute cron job with the given id (optional)
*
Expand Down Expand Up @@ -114,6 +120,11 @@ protected function _launchFile($file)

protected function _getLastScheduledRunTime($job)
{
$cronTab = implode(' ', [$job[1], $job[2], $job[3], $job[4], $job[5]]);
$expression = new Cron($cronTab);

return $expression->getNext();
/*
$extjob = [];
$this->_parseElement($job[self::C_MINUTE], $extjob[self::C_MINUTE], 60);
Expand Down Expand Up @@ -152,6 +163,7 @@ protected function _getLastScheduledRunTime($job)
}
return mktime($dateArr['hours'], $dateArr['minutes'], 0, $dateArr['mon'], $dateArr['mday'], $dateArr['year']);
*/
}

protected function _parseElement($element, &$targetArray, $numberOfElements)
Expand Down
Loading

0 comments on commit 59addca

Please sign in to comment.