class Illuminate / Foundation / Console / Kernel
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

Kernel

Implements

Uses

Properties

protected

$app Application

The application implementation.

Default: null
protected

$events Dispatcher

The event dispatcher implementation.

Default: null
protected

$symfonyDispatcher Symfony\...\EventDispatcherInterface|null

The Symfony event dispatcher implementation.

Default: null
protected

$artisan Application |null

The Artisan application instance.

Default: null
protected

$commands array

The Artisan commands provided by the application.

Default: []
protected

$commandsLoaded bool

Indicates if the Closure commands have been loaded.

Default: false
protected

$commandLifecycleDurationHandlers array

All of the registered command duration handlers.

Default: []
protected

$commandStartedAt Carbon |null

When the currently handled command started.

Default: null
protected

$bootstrappers string[]

The bootstrap classes for the application.

Default: array

Methods

public

__construct ( Application $app , Dispatcher $events ) : void

Create a new console kernel instance.

Parameters

public

rerouteSymfonyCommandEvents ( ) : $this

Re-route the Symfony command events to their Laravel counterparts.

protected

defineConsoleSchedule ( ) : void

Define the application's command schedule.

protected

scheduleCache ( ) : string

Get the name of the cache store that should manage scheduling mutexes.

public

handle ( $input , $output ) : int

Run the console application.

Parameters

  • $input Symfony\...\InputInterface
  • $output Symfony\...\OutputInterface|null
public

terminate ( $input , $status ) : void

Terminate the application.

Parameters

  • $input Symfony\...\InputInterface
  • $status int
public

whenCommandLifecycleIsLongerThan ( $threshold , $handler ) : void

Register a callback to be invoked when the command lifecycle duration exceeds a given amount of time.

Parameters

public

commandStartedAt ( ) : Carbon |null

When the command being handled started.

protected

schedule ( Schedule $schedule ) : void

Define the application's command schedule.

Parameters

protected

scheduleTimezone ( ) : DateTimeZone |string|null

Get the timezone that should be used by default for scheduled events.

protected

commands ( ) : void

Register the commands for the application.

public

command ( $signature , Closure $callback ) : ClosureCommand

Register a Closure based command with the application.

Parameters

protected

load ( $paths ) : void

Register all of the commands in the given directory.

Parameters

  • $paths array|string
protected

commandClassFromFile ( SplFileInfo $file , string $namespace ) : string

Extract the command class name from the given file path.

Parameters

public

registerCommand ( $command ) : void

Register the given command with the console application.

Parameters

  • $command Symfony\...\Command
public

call ( $command , array $parameters , $outputBuffer ) : int

Run an Artisan console command by name.

Parameters

  • $command string
  • $parameters array
  • $outputBuffer Symfony\...\OutputInterface|null
public

queue ( $command , array $parameters ) : PendingDispatch

Queue the given console command.

Parameters

  • $command string
  • $parameters array
public

all ( ) : array

Get all of the commands registered with the console.

public

output ( ) : string

Get the output for the last run command.

public

bootstrap ( ) : void

Bootstrap the application for artisan commands.

public

bootstrapWithoutBootingProviders ( ) : void

Bootstrap the application without booting service providers.

protected

getArtisan ( ) : Application

Get the Artisan application instance.

public

setArtisan ( $artisan ) : void

Set the Artisan application instance.

Parameters

protected

bootstrappers ( ) : array

Get the bootstrap classes for the application.

protected

reportException ( Throwable $e ) : void

Report the exception to the exception handler.

Parameters

protected

renderException ( $output , Throwable $e ) : void

Render the given exception.

Parameters

  • $output Symfony\...\OutputInterface
  • $e Throwable