Load schedules

@return void
321830
protected function loadSchedules()
    {
        /* @var Mage_Cron_Model_Resource_Schedule_Collection $collection */
        $collection = Mage::getModel('cron/schedule')->getCollection();

        $minDate = null;
        $maxDate = null;

        foreach ($collection as $schedule) {
            /* @var Aoe_Scheduler_Model_Schedule $schedule */
            $startTime = $schedule->getStarttime();
            if (empty($startTime)) {
                continue;
            }
            $minDate = is_null($minDate) ? $startTime : min($minDate, $startTime);
            $maxDate = is_null($maxDate) ? $startTime : max($maxDate, $startTime);
            $this->schedules[$schedule->getJobCode()][] = $schedule;
        }

        $this->starttime = $this->hourFloor(strtotime($minDate));
        $this->endtime = $this->hourCeil(strtotime($maxDate));
    }
1272029
protected function job(): void
    {
        $balances = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($balances->isCachedLoad()) return;

        collect($balances)->each(function ($balance) {

            CorporationWalletBalance::firstOrNew([
                'corporation_id' => $this->getCorporationId(),
                'division'       => $balance->division,
            ])->fill([
                'balance' => $balance->balance,
            ])->save();

        });
    }
480259
protected function _prepareCollection()
    {
        /** @var Aoe_Scheduler_Model_Resource_Job_Collection $collection */
        $collection = Mage::getSingleton('aoe_scheduler/job')->getCollection();
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }
345592
public function getSchedule()
    {
        $list = [];

        foreach ($this->schedule as $time => $jobs) {
            foreach ($jobs as $job) {
                $list[$time][] = $job->getId();
            }
        }

        return $list;
    }
758988
protected function loadEyewitnessSchedules()
    {
        $this->app->booted(function () {
            $schedule = $this->app->make(Schedule::class);

            if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
                $schedule->command('eyewitness:poll')->cron('* * * * *')->runInBackground();
                $schedule->command('eyewitness:custom')->cron('* * * * *')->runInBackground();
                $schedule->command('eyewitness:prune')->cron('56 1 * * *')->runInBackground();
            } else {
                $schedule->command('eyewitness:poll')->cron('* * * * *');
                $schedule->command('eyewitness:custom')->cron('* * * * *');
                $schedule->command('eyewitness:prune')->cron('56 1 * * *');
            }

            if (config('eyewitness.monitor_ssl')) {
                if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
                    $schedule->command('eyewitness:monitor-ssl')->cron($this->eye->getMinuteSeed(1).' * * * *')->runInBackground();
                    $schedule->command('eyewitness:monitor-ssl --result')->cron($this->eye->getMinuteSeed(31).' * * * *')->runInBackground();
                } else {
                    $schedule->command('eyewitness:monitor-ssl')->cron($this->eye->getMinuteSeed(1).' * * * *');
                    $schedule->command('eyewitness:monitor-ssl --result')->cron($this->eye->getMinuteSeed(31).' * * * *');
                }
            }

            if (config('eyewitness.monitor_dns')) {
                if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
                    $schedule->command('eyewitness:monitor-dns')->cron($this->eye->getMinuteSeed(10).' * * * *')->runInBackground();
                } else {
                    $schedule->command('eyewitness:monitor-dns')->cron($this->eye->getMinuteSeed(10).' * * * *');
                }
            }

            if (config('eyewitness.monitor_composer')) {
                if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
                    $schedule->command('eyewitness:monitor-composer')->cron($this->eye->getMinuteSeed(20).' '.$this->eye->getHourSeed().' * * *')->runInBackground();
                } else {
                    $schedule->command('eyewitness:monitor-composer')->cron($this->eye->getMinuteSeed(20).' '.$this->eye->getHourSeed().' * * *');
                }
            }
        });
    }
1280085
protected function loadSchedule($schedule)
    {
        if (($schedules = $this->app['config']['console.schedules']) == null) {
            return;
        }

        foreach ($schedules as $definition) {
            $type = $definition['type'] ?? 'command';

            if (! method_exists($this, $method = 'define'.ucfirst($type).'Schedule')) {
                throw new InvalidArgumentException("Schedule [{$type}] is not support.");
            }

            $this->$method($schedule, $definition);
        }
    }
419667
protected function defineConsoleSchedule()
    {
        $this->app->instance(
            'Illuminate\Console\Scheduling\Schedule', $schedule = new Schedule($this->app[Cache::class])
        );

        $this->schedule($schedule);
    }
685147
private function loadIndexes(): void
    {
        if (null !== $this->gsi) {
            return;
        }

        $this->gsi = [];
        foreach ($this->getIndexes() as $gsi) {
            $this->gsi[$gsi->getAlias()] = $gsi;
        }
    }
252599
protected function loadCronModule(){
        //Consigo las variables globales para linea de comandos
        global $argv, $argc;
        //Analizo si se pasa por lo menos un parametros (nombre cron), el primer parametros es el nombre del archivo y el segundo en nombre de la clase
        //pregunta por >= 2
        if($argc >= 2){
            $this->cronCore= new Cron\CronCore($this, $argv);            
        }else{
            Error::general_error('Cron Controller', 'There isent define any cron controller name');
        }    
    }
880245
protected function loadRoutes() : void
    {
        $routeConfig = Core::i()->config->getConfiguration('routes');
        // If there is a default route, make it last in the array
        if (isset($routeConfig['default'])) {
            $default_route = $routeConfig['default'];
            unset($routeConfig['default']);
            $routeConfig['default'] = $default_route;
        }
        // Parse the routes and build the regex strings
        foreach ($routeConfig as $route_name => $route) {
            $regex = $route['route'];
            $regex = str_replace('/', '\/', $regex);
            $regex = str_replace('[', '(', $regex);
            $regex = str_replace(']', ')?', $regex);
            if (isset($route['constraints'])) {
                foreach ($route['constraints'] as $key => $constraint) {
                    $regex = str_replace(':' . $key . ':', "(?P<{$key}>" . $constraint . ')', $regex);
                }
            }
            $routeConfig[$route_name]['regex'] = '/^' . $regex . '$/i';
        }
        $this->route_definitions = $routeConfig;
    }
713650
public function enableAction()
    {
        $codes = $this->getMassActionCodes();
        foreach ($codes as $code) {
            /** @var Aoe_Scheduler_Model_Job $job */
            $job = Mage::getModel('aoe_scheduler/job')->load($code);
            if ($job->getJobCode() && !$job->getIsActive()) {
                $job->setIsActive(true)->save();
                $this->_getSession()->addSuccess($this->__('Enabled "%s"', $code));

                /* @var Aoe_Scheduler_Model_ScheduleManager $scheduleManager */
                $scheduleManager = Mage::getModel('aoe_scheduler/scheduleManager');
                $scheduleManager->generateSchedulesForJob($job);
                $this->_getSession()->addNotice($this->__('Job "%s" has been scheduled.', $job->getJobCode()));
            }
        }
        $this->_redirect('*/*/index');
    }
359598
protected function load()
	{
		$this->rules = [];
		$rules = DiscHelper::loadFromFile($this->ruleFile);
		foreach ($rules as $name => $ruleData) {
			$this->rules[$name] = unserialize($ruleData);
		}
	}
274958
private function autoload_plugins($scheduler)
  {
    if (env('DEV_AUTOLOAD_PLUGINS') == true) {
      $plugins = config('app.plugins');

      foreach($plugins as $plugin => $class) {
        $class::schedule($scheduler);
      }
    }
  }
709662
protected function runScheduledEvents()
    {
        foreach ($this->schedule->dueEvents($this->laravel) as $event) {
            $event = $this->convertEvent($event);

            if ($this->canAccessFiltersPass($event) && (! $event->filtersPass($this->laravel))) {
                continue;
            }

            if ($event->onOneServer) {
                $this->runSingleServerEvent($event);
            } else {
                $this->runEvent($event);
            }
        }
    }
1296915
public function run()
    {

        // Check if we have the schedules, else,
        // insert them
        foreach ($this->schedule as $job) {

            if (! DB::table('schedules')->where('command', $job['command'])->first())
                DB::table('schedules')->insert($job);
        }
    }
257342
protected function schedule(Schedule $schedule)
    {
        $schedules = $this->app['config']->get('mount.schedules', []);
        foreach ($schedules as $scheduleCommand) {
            (new $scheduleCommand())->handle($schedule);
        }
    }
1182082
public function scheduleNowAction()
    {
        $codes = $this->getMassActionCodes();
        foreach ($codes as $key) {
            Mage::getModel('cron/schedule')
                ->setJobCode($key)
                ->setScheduledReason(Aoe_Scheduler_Model_Schedule::REASON_SCHEDULENOW_WEB)
                ->schedule()
                ->save();

            $this->_getSession()->addSuccess($this->__('Job "%s" has been scheduled.', $key));
        }
        $this->_redirect('*/*/index');
    }