當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Schedule::command方法代碼示例

本文整理匯總了PHP中Illuminate\Console\Scheduling\Schedule::command方法的典型用法代碼示例。如果您正苦於以下問題:PHP Schedule::command方法的具體用法?PHP Schedule::command怎麽用?PHP Schedule::command使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Console\Scheduling\Schedule的用法示例。


在下文中一共展示了Schedule::command方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule $schedule
  *
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     // 進入維護模式
     $schedule->command('down')->evenInMaintenanceMode()->dailyAt('23:00');
     //->when(function () {return true;});//
     // 更新用戶等級
     $schedule->call(function () {
         $registrations = Registration::where('state', 0)->where(function ($query) {
             $query->where('registration_date', Carbon::yesterday()->toDateString());
         })->get();
         foreach ($registrations as $registration) {
             $user = $registration->user;
             $user->credit_level -= 1;
             $user->save();
         }
     })->evenInMaintenanceMode()->daily();
     //
     // 重置rest_num
     $schedule->call(function () {
         $doctor_schedules = DocSchedule::where('state', 0)->where(function ($query) {
             $week = [1 => 'monday', 2 => 'tuesday', 3 => 'wednesday', 4 => 'thursday', 5 => 'friday', 6 => 'saturday', 7 => 'sunday'];
             $query->where('doctoring_date', $week[Carbon::today()->dayOfWeek]);
         })->get();
         foreach ($doctor_schedules as $doctor_schedule) {
             $doctor_schedule->rest_num = $doctor_schedule->total_num;
             $doctor_schedule->save();
         }
     })->evenInMaintenanceMode()->dailyAt('3:00');
     //
     // 離開維護模式
     $schedule->command('up')->evenInMaintenanceMode()->dailyAt('7:00');
     //
 }
開發者ID:Beyond-Game,項目名稱:Raffaello,代碼行數:41,代碼來源:Kernel.php

示例2: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('proxy:check')->twiceDaily();
     $schedule->command('proxy:fetch')->twiceDaily()->after(function () {
         Artisan::call('proxy:security');
     });
 }
開發者ID:revolucaodosbytes,項目名稱:ahoy-api,代碼行數:13,代碼來源:Kernel.php

示例3: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     $schedule->command('backup:clean')->daily()->at('01:00');
     $schedule->command('backup:run')->daily()->at('02:00');
     $schedule->command('backup:monitor')->daily()->at('03:00');
 }
開發者ID:goatatwork,項目名稱:access2,代碼行數:13,代碼來源:Kernel.php

示例4: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     //$schedule->command('inspire')
     //->hourly();
     $schedule->command('backup:database')->daily();
     $schedule->command('backup:tidy')->dailyAt('1:00');
 }
開發者ID:richbnaks7,項目名稱:simple-laravel-backup,代碼行數:13,代碼來源:Kernel.php

示例5: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $file = app_path() . '/../posts.out';
     $schedule->command('vk:load_posts')->everyFiveMinutes()->sendOutputTo($file);
     $file = app_path() . '/../review.out';
     $schedule->command('vk:load_reviews')->hourly()->sendOutputTo($file);
 }
開發者ID:stcoder,項目名稱:uf-vova,代碼行數:13,代碼來源:Kernel.php

示例6: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     // $schedule->command('inspire')->hourly();
     $schedule->command('routine:transfer-data')->everyMinute();
     $schedule->command('routine:send-email')->dailyAt('11:00');
     $schedule->command('routine:send-email')->dailyAt('17:00');
 }
開發者ID:imxseraph,項目名稱:sign-system,代碼行數:13,代碼來源:Kernel.php

示例7: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('delete:jobs')->hourly();
     $schedule->command('truncate:jobs')->dailyAt('23:00');
     $schedule->command('check:OfficielEssai')->dailyAt('23:00');
     $schedule->command('check:generateBillReduction')->dailyAt('23:00');
     $schedule->command('GenarateBills:billsThreeMonths')->dailyAt('23:00');
     $schedule->command('GenerateBills:ThreeMonthsNormal')->dailyAt('23:00');
     $schedule->command('GenerateBills:SixMonths')->dailyAt('23:00');
     $schedule->command('GenerateBills:SixMonthsNormal')->dailyAt('23:00');
     $schedule->command('Manage:years')->daily();
     $schedule->command('nextyear:current')->daily();
     /* $schedule->command('log:demo')->daily()->when(function(){
            if(Carbon::now()->toDateString() == Carbon::now()->startOfMonth()->toDateString())
            {
                return true;
            }
        });*/
     /*$schedule->command('log:demo')->everyMinute()->when(function(){
           if(Carbon::now()->toDateString() == Carbon::now()->toDateString())
           {
               return true;
           }
       });*/
     // $schedule->command('inspire') ->hourly();
     //$schedule->command('log:demo')->monthly();
 }
開發者ID:khaleader,項目名稱:creche,代碼行數:33,代碼來源:Kernel.php

示例8: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     $schedule->command('sms:update');
     $schedule->command('sms:push');
     // $schedule->command('queue:listen');
 }
開發者ID:FaddliLWibowo,項目名稱:sms,代碼行數:13,代碼來源:Kernel.php

示例9: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     if (env('APP_ENV') != 'local') {
         $schedule->command('rets:properties --function=pull')->dailyAt('13:00')->withoutOverlapping();
         $schedule->command('rets:properties --function=remove')->dailyAt('14:00')->withoutOverlapping();
     }
 }
開發者ID:SapioBeasley,項目名稱:jacobsgroupvegas.com,代碼行數:13,代碼來源:Kernel.php

示例10: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('snipeit:inventory-alerts')->daily();
     $schedule->command('snipeit:expiring-alerts')->daily();
     $schedule->command('snipeit:backup')->weekly();
     $schedule->command('backup:clean')->daily();
 }
開發者ID:dmeltzer,項目名稱:snipe-it,代碼行數:13,代碼來源:Kernel.php

示例11: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     // Backups.
     $schedule->command('backup:run --only-db')->cron('50 * * * * *');
     $schedule->command('backup:clean')->daily()->at('02:30');
     $schedule->command('backup:monitor')->daily()->at('04:30');
 }
開發者ID:CUMSA,項目名稱:members,代碼行數:13,代碼來源:Kernel.php

示例12: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     $schedule->command('dataSourceVancouverIslandWeather')->everyMinute();
     $schedule->command('zoomLevelTuning')->everyMinute();
     $schedule->command('databaseCleaning')->hourly();
 }
開發者ID:seamxr,項目名稱:weatherbot,代碼行數:13,代碼來源:Kernel.php

示例13: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('poller:ping')->everyFiveMinutes();
     $schedule->command('poller:snmp')->everyFiveMinutes();
     $schedule->command('poller:port')->everyFiveMinutes();
     $schedule->command('poller:port --interval=daily --status=A')->daily();
 }
開發者ID:afdalwahyu,項目名稱:lnms,代碼行數:13,代碼來源:Kernel.php

示例14: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     /* LIST OF HELPER FUNCTION CAN BE FOUND IN htdocs/laravel/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php */
     /* You need to register single laravel cron on server that runs every minute, checks for any Scheduled command and run them */
     /* Single laravel cron to be registered on server "* * * * * php htdocs/laravel/artisan schedule:run >> /dev/null 2>&1" */
     $schedule->command('laracasts:clear-history')->monthly()->thenPing('url');
     // Scheduling Artisan command, run "php artisan laracasts:clear-history" command every month and ping a specific URL.
     //
     // In order to "emailOutputTo", you should first "sendOutputTo" to save the output to be emailed
     $schedule->command('laracasts:clear-history')->monthly()->sendOutputTo('path/to/file')->emailOutputTo('email@me.com');
     // Scheduling Artisan command, run "php artisan laracasts:clear-history" command every month, save output to a specific file and email that output to a specific email.
     $schedule->command('laracasts:clear-history')->monthly()->sendOutputTo('path/to/file');
     // Scheduling Artisan command, run "php artisan laracasts:clear-history" command every month and save output to a specific file
     $schedule->command('laracasts:clear-history')->monthly();
     // Scheduling Artisan command, run "php artisan laracasts:clear-history" command every month
     $schedule->command('laracasts:daily-report')->dailyAt('23:55');
     // Scheduling Artisan command, run "php artisan laracasts:daily-report" command every day at "23:55"
     //$schedule->exec('touch foo.txt')->dailyAt('10:30'); // Scheduling Execution command, create "foo.txt" file every day at "10:30"
     //$schedule->exec('touch foo.txt')->daily(); // Scheduling Execution command, create "foo.txt" file every day
     //$schedule->exec('touch foo.txt')->everyFiveMinutes(); // Scheduling Execution command, create "foo.txt" file every five minutes
     /*
     * $schedule->command('inspire')
             ->hourly(); // Scheduling Artisan command, run "php artisan inspire" every hour
     */
 }
開發者ID:fahad-farrukh,項目名稱:intermediate-laravel,代碼行數:31,代碼來源:Kernel.php

示例15: schedule

 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule $schedule
  *
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     /**
      * Create the schedule based upon what is in the `harvests` table
      */
     try {
         $harvests = Harvest::all();
         foreach ($harvests as $harvest) {
             /**
              * Both ping_before_url and then_ping_url could be NULL
              * in the database but things will fail silently if NULL
              * is passed to pingBefore() or thenPing().
              *
              * This still assumes that if there is a value that it
              * is both valid and GET-able. If either is not a valid
              * URL or that URL does not return a response a silent
              * failure could still occur.
              */
             if ($harvest->ping_before_url !== null && $harvest->then_ping_url !== null) {
                 $schedule->command('harvest:update ' . $harvest->resource . ' --action=' . $harvest->action)->{$harvest->scheduler_frequency_method}()->withoutOverlapping()->pingBefore($harvest->ping_before_url)->thenPing($harvest->then_ping_url);
             } elseif ($harvest->ping_before_url !== null && $harvest->then_ping_url === null) {
                 $schedule->command('harvest:update ' . $harvest->resource . ' --action=' . $harvest->action)->{$harvest->scheduler_frequency_method}()->withoutOverlapping()->pingBefore($harvest->ping_before_url);
             } elseif ($harvest->ping_before_url === null && $harvest->then_ping_url !== null) {
                 $schedule->command('harvest:update ' . $harvest->resource . ' --action=' . $harvest->action)->{$harvest->scheduler_frequency_method}()->withoutOverlapping()->thenPing($harvest->then_ping_url);
             } else {
                 // Both are null
                 $schedule->command('harvest:update ' . $harvest->resource . ' --action=' . $harvest->action)->{$harvest->scheduler_frequency_method}()->withoutOverlapping();
             }
         }
     } catch (\Exception $e) {
         // Hopefully we are only here because we are migrating,
         // which does not like the database query above.
     }
 }
開發者ID:jwcobb,項目名稱:tevo-harvester,代碼行數:41,代碼來源:Kernel.php


注:本文中的Illuminate\Console\Scheduling\Schedule::command方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。