Determine if the Cron expression passes.

@return bool
960233
protected function expressionPasses()
    {
        $date = new \DateTime('now');
        if ($this->_timezone) {
            $date->setTimezone($this->_timezone);
        }
        return CronExpression::factory($this->_expression)->isDue($date);
    }
276709
public function isExpired()
    {
        if ($this->getExpiresAt() instanceof \DateTime) {
            return $this->getExpiresAt()->getTimestamp() < time();
        }

        if ($this->isAppAccessToken()) {
            return false;
        }

        return null;
    }
884394
public function isCronConfigured()
    {
        $r1From = new \DateTime('-' . $this->checkingCronPeriod);
        $r1To = new \DateTime('+' . $this->checkingCronPeriod);

        $r2From = new \DateTime('- 1 hour');
        $r2To = new \DateTime();

        $format = \Espo\Core\Utils\DateTime::$systemDateTimeFormat;

        $selectParams = [
            'select' => ['id'],
            'leftJoins' => ['scheduledJob'],
            'whereClause' => [
                'OR' => [
                    [
                        ['executedAt>=' => $r2From->format($format)] ,
                        ['executedAt<=' => $r2To->format($format)],
                    ],
                    [
                        ['executeTime>=' => $r1From->format($format)],
                        ['executeTime<='=> $r1To->format($format)],
                        'scheduledJob.job' => 'Dummy'
                    ]
                ]
            ]
        ];


        return !!$this->getEntityManager()->getRepository('Job')->findOne($selectParams);
    }
86527
function(id, crons) {
  for(var i=0, l=crons.length; i<l; i++) {
    if(id === crons[i].id) {
      return true;
    }
  }
  return false;
}
973180
public function verify()
    {
        // Check if time is expired
        $time = $this->request->getQuery('timestamp');
        if ($this->expireTime && time() - $time > $this->expireTime) {
            return false;
        }

        // Remove signature parameters
        $query = $this->request->getParameterReference('get');
        $token = $this->request->getQuery('signature');
        unset($query['signature']);

        $timestamp = $query['timestamp'];

        $query = $this->filterKeys($query, $this->params);

        $query['timestamp'] = $timestamp;

        return $this->generateToken($query) == $token;
    }
615779
public function checkCronExt( )
    {
        $result = 0;                                    // kein Cron
        $objDB = \Database::getInstance();

        if( $objDB->tableExists('tl_crontab') ) {
            $result = 1;                                // Cron vorhanden, kein Job

            $objJob = $objDB->execute("SELECT * FROM tl_crontab WHERE job='system/modules/BackupDB/public/AutoBackupDB.php' LIMIT 1");
            if( $objJob->next() ) {                     // IF( Job vorhanden )
                $result = $objJob->enabled ? 3 : 2;     //   Job AKTIV(3) oder Job INAKTIV(2)
            }
        }
        return $result;
    }
494002
public function validateCronExpression($cronExpression)
    {
        try {
            $schedule = Mage::getModel('cron/schedule');
            /* @var $schedule Mage_Cron_Model_Schedule */
            $schedule->setCronExpr($cronExpression);
        } catch (Exception $e) {
            return false;
        }
        return true;
    }
271142
public function listCronsStatus()
    {
        /** @var SmileCron[] $smileCrons */
        $smileCrons = $this->repository->listCrons();

        /** @var CronInterface[] $crons */
        $crons = $this->getCrons();
        $cronAlias = array();

        foreach ($crons as $cron) {
            $cronAlias[$cron->getAlias()] = $cron;
        }

        if ($smileCrons) {
            foreach ($smileCrons as $smileCron) {
                if (isset($cronAlias[$smileCron->getAlias()])) {
                    $cronAlias[$smileCron->getAlias()] = $smileCron;
                }
            }
        }

        return $cronAlias;
    }
1046407
public function isSuccess() : bool
    {
        Assert::keyExists($this->status, "Code");

        return $this->status['Code'] === Constants::STATUS_SUCCESS;
    }
593730
public function process()
    {
        $em = $this->getEm();
        $cronRegistry = $this->getCronjobs();
        $pending = $this->getPending();
        $scheduleLifetime = $this->scheduleLifetime * 60; //convert min to sec

        $now = new \DateTime;
        foreach ($pending as $job) {
            $scheduleTime = $job->getScheduleTime();

            if ($scheduleTime > $now) {
                continue;
            }

            try {
                $errorStatus = Mapper\Cronjob::STATUS_ERROR;

                $missedTime = clone $now;
                $timestamp = $missedTime->getTimestamp();
                $timestamp -= $scheduleLifetime;
                $missedTime->setTimestamp($timestamp);

                if ($scheduleTime < $missedTime) {
                    $errorStatus = Mapper\Cronjob::STATUS_MISSED;
                    throw new Exception\RuntimeException(
                        'too late for job'
                    );
                }

                $code = $job->getCode();

                if (!isset($cronRegistry[$code])) {
                    throw new Exception\RuntimeException(sprintf(
                        'job "%s" undefined in cron registry',
                        $code
                    ));
                }

                if (!$this->tryLockJob($job)) {
                    //another cron started this job intermittently. skip.
                    continue;
                }

                //run job now
                $callback = $cronRegistry[$code]['callback'];
                $args = $cronRegistry[$code]['args'];

                $job->setExecuteTime(new \DateTime);
                $em->persist($job);
                $em->flush();

                call_user_func_array($callback, $args);

                $job
                    ->setStatus(Mapper\Cronjob::STATUS_SUCCESS)
                    ->setFinishTime(new \DateTime);

            } catch (\Exception $e) {
                $job
                    ->setStatus($errorStatus)
                    ->setErrorMsg($e->getMessage())
                    ->setStackTrace($e->getTraceAsString());
            }

            $em->persist($job);
            $em->flush();
        }

        return $this;
    }
872966
public function checkIfReady()
    {
        if (!$this->attrs->paramsDone || !$this->attrs->inputDone) {
            return false;
        }
        if (isset($this->appInstance->passphrase)) {
            if (!isset($this->attrs->server['PASSPHRASE'])
                || ($this->appInstance->passphrase !== $this->attrs->server['PASSPHRASE'])
            ) {
                $this->finish();
            }

            return false;
        }

        if ($this->attrs->input->isFrozen()) {
            return false;
        }

        if ($this->sleepTime === 0) {
            $this->wakeup();
        }

        return true;
    }
555434
public function isToday(): bool
    {
        return $this->date->format('Y-m-d') === Date::now($this->date->timezone())->format('Y-m-d');
    }
420197
private function writeCronFile()
    {
        if (empty($this->cronFile)) {
            return false;
        }

        if (!is_file($this->cronFile)) {
            return false;
        }

        if (!is_writable($this->cronFile)) {
            return false;
        }

        return file_put_contents($this->cronFile, $this->generateCron());
    }
393730
public function passes()
    {
        $validator = $this->validator->make($this->data, $this->rules, $this->messages);

        if( $validator->fails() )
        {
            $this->errors = $validator->messages();
            return false;
        }

        return true;
    }
14856
public function passes()
    {
        $this->message = null;
        foreach ($this->rules as $attribute => $rules) {
            foreach ($rules as $rule) {
                if (!$this->validate($attribute, $rule)) {
                    return false;
                }
            }
        }

        return true;
    }
1316512
public function isDue()
    {

        $date = Carbon::now();

        if ($this->timezone) {
            $date->setTimezone($this->timezone);
        }

        $response = CronExpression::factory($this->getPatternString())->isDue($date->toDateTimeString());

        return $response && $this->resolveWhen();
    }
1199077
protected function checkTime()
    {
        $result = false;

        $lastExecution = $this->getExecutionTime();
        $interval = $this->getInterval();
        $anonymous = \common_session_SessionManager::isAnonymous();

        if ($lastExecution === null && !$anonymous) {
            $result = true;
        } elseif($lastExecution !== null && $interval !== null && !$anonymous) {
            $mustBeExecutedAt = clone($lastExecution);
            $mustBeExecutedAt->add($interval);
            $now = new DateTime('now');
            $result = ($mustBeExecutedAt < $now);
        }

        return $result;
    }