當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。