Add scheduled commands.

This commit is contained in:
Taylor Otwell
2014-11-18 22:48:38 -06:00
parent e3e7cc499f
commit a7e6a89c91
4 changed files with 39 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
<?php namespace App\Console;
use Exception;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel {
@@ -15,26 +16,15 @@ class Kernel extends ConsoleKernel {
];
/**
* Run the console application.
* Define the application's command schedule.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
public function handle($input, $output = null)
protected function schedule(Schedule $schedule)
{
try
{
return parent::handle($input, $output);
}
catch (Exception $e)
{
$this->reportException($e);
$this->renderException($output, $e);
return 1;
}
$schedule->artisan('foo')
->hourly();
}
}