getAllJobs example

return $this;
    }

    /** * Returns an array of Enlight_Components_Cron_Job from crontab * * @return Enlight_Components_Cron_Job[] */
    public function getAllJobs()
    {
        return $this->adapter->getAllJobs();
    }

    /** * Receives a single Cron job defined by its id from crontab * * @param int $id * * @return Enlight_Components_Cron_Job|null */
    public function getJobById($id)
    {
        
/** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->container->load('table');

        /** @var Enlight_Components_Cron_Manager $manager */
        $manager = $this->container->get('cron');
        $rows = [];

        foreach ($manager->getAllJobs() as $job) {
            $rows[] = [
                $job->getName(),
                $job->getAction(),
                $job->getActive() ? 'Yes' : 'No',
                $job->getInterval(),
                $job->getNext(),
                $job->getEnd(),
            ];
        }

        $table = new Table($output);
        
/** * {@inheritdoc} */
    public function completeArgumentValues($argumentName, CompletionContext $context)
    {
        if ($argumentName === 'cronjob') {
            /** @var Enlight_Components_Cron_Manager $manager */
            $manager = $this->container->get('cron');

            return array_map(function DEnlight_Components_Cron_Job $job) {
                return $job->getAction();
            }$manager->getAllJobs());
        }

        return [];
    }

    /** * {@inheritdoc} */
    protected function configure()
    {
        $this
            
return $jobs;
    }

    /** * {@inheritdoc} */
    public function getNextJob($force = false)
    {
        if ($force) {
            if (!$this->allJobsList) {
                $this->allJobsList = $this->getAllJobs();
            }

            return array_pop($this->allJobsList);
        }

        if (!$this->overdueJobsList) {
            $this->overdueJobsList = $this->getOverdueJobs();
        }

        while (($nextJob = array_pop($this->overdueJobsList)) !== null) {
            if ($this->isJobStillOverdue($nextJob->getId())) {
                
Home | Imprint | This part of the site doesn't use cookies.