本文整理汇总了PHP中Illuminate\Console\Scheduling\Schedule类的典型用法代码示例。如果您正苦于以下问题:PHP Schedule类的具体用法?PHP Schedule怎么用?PHP Schedule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Schedule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->call(function () {
$handler = new App\AlertHandler(new App\Curl());
$handler->sendAlertEmails(env('ALERT_FETCH_RANGE'));
})->thenPing(env('ALERT_SEND_HEARTBEAT'))->everyMinute();
}
示例2: 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->call(function (){
// IpLocation::detectAllLocation();
// })->cron('* * * * *');
}
示例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->call('App\Http\Controllers\WelcomeController@testMail')->everyFiveMinutes();
$schedule->call('App\\Http\\Controllers\\API\\ShippingAPIController@autoCheckWaybill')->everyFiveMinutes();
$schedule->call('App\\Http\\Controllers\\API\\MailAPIController@registerInvitationMail')->everyFiveMinutes();
}
示例4: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @return void
*/
protected function schedule(Schedule $schedule)
{
$prefix = Carbon::now()->format('Y/m/d/');
$schedule->command('backup:run --only-db --prefix="db/' . $prefix . '"')->hourly();
$schedule->command('backup:run --prefix="files/' . $prefix . '"')->weekly();
$schedule->command('backup:clean')->daily();
}
示例5: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')->hourly();
//tsipizic check
$schedule->call(function () {
})->everyFiveMinutes();
}
示例6: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// get jobs
$schedule->command('queue:work')->everyFiveMinutes()->withoutOverlapping();
$schedule->command('tasks:pending')->dailyAt('11:00')->withoutOverlapping();
$schedule->command('tasks:pending')->everyMinute()->withoutOverlapping();
}
示例7: 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('alert:artist')->daily()->appendOutputTo('storage\\logs\\sendRep.txt');
//Send mail alerting artist
}
示例8: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->call(function(){
// Reader::index();
// })->everyFiveMinutes();
$schedule->command('news:update')->everyThirtyMinutes()->sendOutputTo(storage_path() . '/logs/news/news_updater.log');
}
示例9: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//Change valid status of all tickets that no longer qualify as valid
$schedule->call(function () {
DB::table('tickets')->where('dateofdeparture', '<=', Carbon::now())->update(['valid' => 0]);
})->everyMinute();
//Decrement credits from users that have newly invalid tickets that are still tradable and mark them untradable once complete
$schedule->call(function () {
$where["valid"] = '0';
$where["tradable"] = '1';
$tickets = DB::table('tickets')->where($where)->get();
foreach ($tickets as $ticket) {
//Determine the credit value on the class of the ticket to set the decrement amount
switch ($ticket->class) {
case 'Economy':
$ticketValue = 1;
break;
case 'Business':
$ticketValue = 2;
break;
case 'First':
$ticketValue = 3;
break;
case 'Premium':
$ticketValue = 4;
break;
default:
$ticketValue = 1;
break;
}
DB::table('credits')->where('user_id', $ticket->user_id)->decrement('trade', $ticketValue);
DB::table('tickets')->where('id', $ticket->id)->update(['tradable' => 0]);
}
})->everyMinute();
}
示例10: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->call(function () {
$twitterController = new TwitterController();
$twitterController . daemonServiceTrends();
})->everyFiveMinutes();
}
示例11: 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->call(function () {
\App\Http\Controllers\DepressionController::sendEmail();
})->cron('0 0,4,8,12,16,20 * * *');
}
示例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('ltd:sendscheduled')->everyFiveMinutes();
$schedule->command('ltd:notifynotetaker')->dailyAt('05:00');
$schedule->command('ltd:notifypaused')->dailyAt('05:00');
}
示例13: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->call(function () {
Mail::raw('Hi Dries!', function ($message) {
$message->from(env('MAIL_FROM'), env('MAIL_NAME'));
$message->to('driesvanschevensteen@me.com')->subject('Test mail!');
});
})->daily();
$schedule->call(function () {
$expiringAuctions = Auction::getExpiringAuctions();
foreach ($expiringAuctions as $auction) {
$bidders = Bid::getBiddersWithId($auction->id);
$highest = Bid::getHighestBidWithId($auction->id);
$auction->buyer_id = $highest->id;
$auction->save();
foreach ($bidders as $bidWithBidder) {
$bidder = $bidWithBidder->user;
if ($bidder->id = $highest->id) {
Mail::raw('Auction ' . $auction->title . ' ended, you are the highest bidder!', function ($message) use($bidder) {
$message->from(env('MAIL_FROM'), env('MAIL_NAME'));
$message->to($bidder->email)->subject('You are the highest bidder.');
});
} else {
Mail::raw('Auction ' . $auction->title . ' ended, you did not give the highest bid!', function ($message) use($bidder) {
$message->from(env('MAIL_FROM'), env('MAIL_NAME'));
$message->to($bidder->email)->subject("Auction ended, you didn't get it.");
});
}
}
}
})->daily();
}
示例14: 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('emails:daily')->daily();
$schedule->command('motions:rankgeneration')->hourly();
// if(!$motion->lastestRank || $motion->lastestRank->created_at['carbon']->diffInMinutes($now) >= Setting::get('motion.minutes_between_rank_calculations',60)){
}
示例15: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//running queue (every five minutes)
$schedule->command('run:queue QueueCommand')->everyFiveMinutes();
//running queue (every five minutes)
$schedule->command('point:expirequeue PointExpireQueueCommand')->dailyAt('06:00');
}