14 class Cron extends \Magento\Framework\Event\Observer
27 $e = preg_split(
'#\s+#', $this->getCronExpr(),
null, PREG_SPLIT_NO_EMPTY);
28 if (
sizeof($e) !== 5) {
32 $d = getdate($this->
getNow());
57 if (!$this->hasNow()) {
58 $this->setNow(
time());
78 if (strpos($expr,
',') !==
false) {
79 foreach (explode(
',', $expr) as $e) {
88 if (strpos($expr,
'/') !==
false) {
89 $e = explode(
'/', $expr);
90 if (
sizeof($e) !== 2) {
95 if (!is_numeric($mod)) {
103 if (strpos($expr,
'-') !==
false) {
104 $e = explode(
'-', $expr);
105 if (
sizeof($e) !== 2) {
112 return $from !==
false && $to !==
false && $num >= $from && $num <= $to && $num % $mod === 0;
117 return $value !==
false && $num ==
$value && $num % $mod === 0;
matchCronExpression($expr, $num)
getData($key='', $index=null)
isValidFor(\Magento\Framework\Event $event)