class Kernel implements Kernel (View source)

Properties

protected Application $app

The application implementation.

protected Dispatcher $events

The event dispatcher implementation.

protected Application|null $artisan

The Artisan application instance.

protected array $commands

The Artisan commands provided by the application.

protected bool $commandsLoaded

Indicates if the Closure commands have been loaded.

protected string[] $bootstrappers

The bootstrap classes for the application.

Methods

void
__construct(Application $app, Dispatcher $events)

Create a new console kernel instance.

void
defineConsoleSchedule()

Define the application's command schedule.

string
scheduleCache()

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

int
handle(InputInterface $input, OutputInterface|null $output = null)

Run the console application.

void
terminate(InputInterface $input, int $status)

Terminate the application.

void
schedule(Schedule $schedule)

Define the application's command schedule.

DateTimeZone|string|null
scheduleTimezone()

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

void
commands()

Register the commands for the application.

command(string $signature, Closure $callback)

Register a Closure based command with the application.

void
load(array|string $paths)

Register all of the commands in the given directory.

void
registerCommand(Command $command)

Register the given command with the console application.

int
call(string $command, array $parameters = [], OutputInterface|null $outputBuffer = null)

Run an Artisan console command by name.

queue(string $command, array $parameters = [])

Queue the given console command.

array
all()

Get all of the commands registered with the console.

string
output()

Get the output for the last run command.

void
bootstrap()

Bootstrap the application for artisan commands.

getArtisan()

Get the Artisan application instance.

void
setArtisan(Application $artisan)

Set the Artisan application instance.

array
bootstrappers()

Get the bootstrap classes for the application.

void
reportException(Throwable $e)

Report the exception to the exception handler.

void
renderException(OutputInterface $output, Throwable $e)

Render the given exception.

Details

void __construct(Application $app, Dispatcher $events)

Create a new console kernel instance.

Parameters

Application $app
Dispatcher $events

Return Value

void

protected void defineConsoleSchedule()

Define the application's command schedule.

Return Value

void

protected string scheduleCache()

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

Return Value

string

int handle(InputInterface $input, OutputInterface|null $output = null)

Run the console application.

Parameters

InputInterface $input
OutputInterface|null $output

Return Value

int

void terminate(InputInterface $input, int $status)

Terminate the application.

Parameters

InputInterface $input
int $status

Return Value

void

protected void schedule(Schedule $schedule)

Define the application's command schedule.

Parameters

Schedule $schedule

Return Value

void

protected DateTimeZone|string|null scheduleTimezone()

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

Return Value

DateTimeZone|string|null

protected void commands()

Register the commands for the application.

Return Value

void

ClosureCommand command(string $signature, Closure $callback)

Register a Closure based command with the application.

Parameters

string $signature
Closure $callback

Return Value

ClosureCommand

protected void load(array|string $paths)

Register all of the commands in the given directory.

Parameters

array|string $paths

Return Value

void

void registerCommand(Command $command)

Register the given command with the console application.

Parameters

Command $command

Return Value

void

int call(string $command, array $parameters = [], OutputInterface|null $outputBuffer = null)

Run an Artisan console command by name.

Parameters

string $command
array $parameters
OutputInterface|null $outputBuffer

Return Value

int

Exceptions

CommandNotFoundException

PendingDispatch queue(string $command, array $parameters = [])

Queue the given console command.

Parameters

string $command
array $parameters

Return Value

PendingDispatch

array all()

Get all of the commands registered with the console.

Return Value

array

string output()

Get the output for the last run command.

Return Value

string

void bootstrap()

Bootstrap the application for artisan commands.

Return Value

void

protected Application getArtisan()

Get the Artisan application instance.

Return Value

Application

void setArtisan(Application $artisan)

Set the Artisan application instance.

Parameters

Application $artisan

Return Value

void

protected array bootstrappers()

Get the bootstrap classes for the application.

Return Value

array

protected void reportException(Throwable $e)

Report the exception to the exception handler.

Parameters

Throwable $e

Return Value

void

protected void renderException(OutputInterface $output, Throwable $e)

Render the given exception.

Parameters

OutputInterface $output
Throwable $e

Return Value

void