invoiceninja/app/Console/Kernel.php

52 lines
1.3 KiB
PHP
Raw Normal View History

2015-09-25 12:57:40 +03:00
<?php namespace app\Console;
2015-03-12 10:44:39 +10:00
2015-09-25 12:57:40 +03:00
use Utils;
2015-03-12 10:44:39 +10:00
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
2015-09-25 12:57:40 +03:00
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
'App\Console\Commands\SendRecurringInvoices',
'App\Console\Commands\ResetData',
'App\Console\Commands\CheckData',
2015-05-08 11:21:29 +03:00
'App\Console\Commands\SendRenewalInvoices',
2015-09-17 22:01:06 +03:00
'App\Console\Commands\SendReminders',
2016-01-20 01:07:31 +02:00
'App\Console\Commands\TestOFX',
2015-09-25 12:57:40 +03:00
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$logFile = storage_path() . '/logs/cron.log';
$schedule
->command('ninja:send-invoices --force')
->sendOutputTo($logFile)
->withoutOverlapping()
->hourly();
2015-03-12 10:44:39 +10:00
2015-09-25 12:57:40 +03:00
$schedule
->command('ninja:send-reminders --force')
->sendOutputTo($logFile)
->daily();
2015-03-12 10:44:39 +10:00
2015-09-25 12:57:40 +03:00
if (Utils::isNinja()) {
$schedule
->command('ninja:send-renewals --force')
->sendOutputTo($logFile)
->daily();
}
}
2015-03-12 10:44:39 +10:00
}