当前位置: 首页>>代码示例>>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;未经允许,请勿转载。