当前位置: 首页>>代码示例>>PHP>>正文


PHP Schedule::dueEvents方法代码示例

本文整理汇总了PHP中Illuminate\Console\Scheduling\Schedule::dueEvents方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::dueEvents方法的具体用法?PHP Schedule::dueEvents怎么用?PHP Schedule::dueEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Console\Scheduling\Schedule的用法示例。


在下文中一共展示了Schedule::dueEvents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $events = $this->schedule->dueEvents($this->laravel);
     foreach ($events as $event) {
         $this->line('<info>Running scheduled command:</info> ' . $event->getSummaryForDisplay());
         $event->run($this->laravel);
     }
     if (count($events) === 0) {
         $this->info('No scheduled commands are ready to run.');
     }
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:16,代码来源:ScheduleRunCommand.php

示例2: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $events = $this->schedule->dueEvents($this->laravel);
     $eventsRan = 0;
     foreach ($events as $event) {
         if (!$event->filtersPass($this->laravel)) {
             continue;
         }
         $this->line('<info>Running scheduled command:</info> ' . $event->getSummaryForDisplay());
         $event->run($this->laravel);
         ++$eventsRan;
     }
     if (count($events) === 0 || $eventsRan === 0) {
         $this->info('No scheduled commands are ready to run.');
     }
 }
开发者ID:bmitch,项目名称:framework,代码行数:21,代码来源:ScheduleRunCommand.php

示例3: schedule

 /**
  * This method is nearly identical to ScheduleRunCommand shipped with Laravel, but since we are not interested
  * in console output we couldn't reuse it
  *
  * @param Container $laravel
  * @param Kernel $kernel
  * @param Schedule $schedule
  * @return array
  */
 public function schedule(Container $laravel, Kernel $kernel, Schedule $schedule)
 {
     $events = $schedule->dueEvents($laravel);
     $eventsRan = 0;
     $messages = [];
     foreach ($events as $event) {
         if (method_exists($event, 'filtersPass') && (new \ReflectionMethod($event, 'filtersPass'))->isPublic() && !$event->filtersPass($laravel)) {
             continue;
         }
         $messages[] = 'Running: ' . $event->getSummaryForDisplay();
         $event->run($laravel);
         ++$eventsRan;
     }
     if (count($events) === 0 || $eventsRan === 0) {
         $messages[] = 'No scheduled commands are ready to run.';
     }
     return $this->response($messages);
 }
开发者ID:dusterio,项目名称:laravel-aws-worker,代码行数:27,代码来源:WorkerController.php


注:本文中的Illuminate\Console\Scheduling\Schedule::dueEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。