final class Kernel extends Kernel

Traits

Properties

protected EventDispatcher|null $symfonyDispatcher

The Symfony event dispatcher implementation.

from  Kernel
protected Application|null $artisan from  Kernel
protected array<int, class-string> $commands

The Artisan commands provided by your application.

protected array $commandPaths

The paths where Artisan commands should be automatically discovered.

from  Kernel
protected array $commandRoutePaths

The paths where Artisan "routes" should be automatically discovered.

from  Kernel
protected bool $commandsLoaded

Indicates if the Closure commands have been loaded.

from  Kernel
protected array $loadedPaths

The commands paths that have been "loaded".

from  Kernel
protected array $commandLifecycleDurationHandlers

All of the registered command duration handlers.

from  Kernel
protected CarbonImmutable|null $commandStartedAt

When the currently handled command started.

from  Kernel
protected array $bootstrappers

The console application bootstrappers.

from  Kernel

Methods

int
secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

int
currentTime()

Get the current system time as a UNIX timestamp.

string
runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

__construct(Application $app, Dispatcher $events)

No description

from  Kernel
rerouteSymfonyCommandEvents()

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

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

Run the console application.

from  Kernel
void
terminate(InputInterface $input, int $status)

Terminate the application.

from  Kernel
void
whenCommandLifecycleIsLongerThan(CarbonInterval|DateTimeInterface|float|int $threshold, callable $handler)

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

from  Kernel
commandStartedAt()

When the command being handled started.

from  Kernel
void
schedule(Schedule $schedule)

Define the application's command schedule.

from  Kernel
resolveConsoleSchedule()

Resolve a console schedule instance.

from  Kernel
string|null
scheduleTimezone()

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

from  Kernel
string|null
scheduleCache()

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

from  Kernel
void
commands()

Register the commands for the application.

from  Kernel
command(string $signature, Closure $callback)

Register a Closure based command with the application.

from  Kernel
void
load(array|string $paths)

Register all of the commands in the given directory.

from  Kernel
Finder
findCommands(array $paths)

Get the Finder instance for discovering command files.

from  Kernel
string
commandClassFromFile(SplFileInfo $file, string $namespace)

Extract the command class name from the given file path.

from  Kernel
void
registerCommand(Command $command)

Register the given command with the console application.

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

Run an Artisan console command by name.

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

Queue the given console command.

from  Kernel
array
all()

Get all of the commands registered with the console.

from  Kernel
string
output()

Get the output for the last run command.

from  Kernel
void
bootstrap()

Bootstrap the application for artisan commands.

from  Kernel
void
discoverCommands()

Discover the commands that should be automatically loaded.

from  Kernel
void
bootstrapWithoutBootingProviders()

Bootstrap the application without booting service providers.

from  Kernel
bool
shouldDiscoverCommands()

Determine if the kernel should discover commands.

getArtisan()

Get the Artisan application instance.

from  Kernel
void
setArtisan(Application|null $artisan)

Set the Artisan application instance.

from  Kernel
addCommands(array $commands)

Set the Artisan commands provided by the application.

from  Kernel
addCommandPaths(array $paths)

Set the paths that should have their Artisan commands automatically discovered.

from  Kernel
addCommandRoutePaths(array $paths)

Set the paths that should have their Artisan "routes" automatically discovered.

from  Kernel
array
bootstrappers()

Get the bootstrap classes for the application.

from  Kernel
void
reportException(Throwable $e)

Report the exception to the exception handler.

void
renderException(OutputInterface $output, Throwable $e)

Render the given exception.

from  Kernel
int
run(InputInterface|null $input = null, OutputInterface|null $output = null)

Runs the current application.

from  Kernel

Details

in InteractsWithTime at line 17
protected int secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

Parameters

DateInterval|DateTimeInterface|int $delay

Return Value

int

in InteractsWithTime at line 29
protected int availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

int

in InteractsWithTime at line 41
protected DateTimeInterface|int parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

DateTimeInterface|int

in InteractsWithTime at line 57
protected int currentTime()

Get the current system time as a UNIX timestamp.

Return Value

int

in InteractsWithTime at line 65
protected string runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

Parameters

float $startTime
float|null $endTime

Return Value

string

in Kernel at line 104
__construct(Application $app, Dispatcher $events)

No description

Parameters

Application $app
Dispatcher $events

in Kernel at line 124
Kernel rerouteSymfonyCommandEvents()

internal  
 

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

Return Value

Kernel

in Kernel at line 155
int handle(InputInterface $input, OutputInterface|null $output = null)

Run the console application.

Parameters

InputInterface $input
OutputInterface|null $output

Return Value

int

in Kernel at line 25
void terminate(InputInterface $input, int $status)

Terminate the application.

Parameters

InputInterface $input
int $status

Return Value

void

in Kernel at line 228
void whenCommandLifecycleIsLongerThan(CarbonInterval|DateTimeInterface|float|int $threshold, callable $handler)

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

Parameters

CarbonInterval|DateTimeInterface|float|int $threshold
callable $handler

Return Value

void

in Kernel at line 247
CarbonImmutable|null commandStartedAt()

When the command being handled started.

Return Value

CarbonImmutable|null

in Kernel at line 255
void schedule(Schedule $schedule)

Define the application's command schedule.

Parameters

Schedule $schedule

Return Value

void

in Kernel at line 262
Schedule resolveConsoleSchedule()

Resolve a console schedule instance.

Return Value

Schedule

in Kernel at line 272
protected string|null scheduleTimezone()

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

Return Value

string|null

in Kernel at line 282
protected string|null scheduleCache()

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

Return Value

string|null

in Kernel at line 292
void commands()

Register the commands for the application.

Return Value

void

in Kernel at line 299
ClosureCommand command(string $signature, Closure $callback)

Register a Closure based command with the application.

Parameters

string $signature
Closure $callback

Return Value

ClosureCommand

in Kernel at line 315
void load(array|string $paths)

Register all of the commands in the given directory.

Parameters

array|string $paths

Return Value

void

in Kernel at line 357
protected Finder findCommands(array $paths)

Get the Finder instance for discovering command files.

Parameters

array $paths

Return Value

Finder

in Kernel at line 365
protected string commandClassFromFile(SplFileInfo $file, string $namespace)

Extract the command class name from the given file path.

Parameters

SplFileInfo $file
string $namespace

Return Value

string

in Kernel at line 377
void registerCommand(Command $command)

Register the given command with the console application.

Parameters

Command $command

Return Value

void

in Kernel at line 387
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

in Kernel at line 401
PendingDispatch queue(string $command, array $parameters = [])

Queue the given console command.

Parameters

string $command
array $parameters

Return Value

PendingDispatch

in Kernel at line 409
array all()

Get all of the commands registered with the console.

Return Value

array

in Kernel at line 419
string output()

Get the output for the last run command.

Return Value

string

in Kernel at line 429
void bootstrap()

Bootstrap the application for artisan commands.

Return Value

void

in Kernel at line 449
protected void discoverCommands()

Discover the commands that should be automatically loaded.

Return Value

void

in Kernel at line 465
void bootstrapWithoutBootingProviders()

Bootstrap the application without booting service providers.

Return Value

void

at line 32
protected bool shouldDiscoverCommands()

Determine if the kernel should discover commands.

Return Value

bool

in Kernel at line 485
Application getArtisan()

Get the Artisan application instance.

Return Value

Application

in Kernel at line 510
void setArtisan(Application|null $artisan)

Set the Artisan application instance.

Parameters

Application|null $artisan

Return Value

void

in Kernel at line 518
Kernel addCommands(array $commands)

Set the Artisan commands provided by the application.

Parameters

array $commands

Return Value

Kernel

in Kernel at line 532
Kernel addCommandPaths(array $paths)

Set the paths that should have their Artisan commands automatically discovered.

Parameters

array $paths

Return Value

Kernel

in Kernel at line 542
Kernel addCommandRoutePaths(array $paths)

Set the paths that should have their Artisan "routes" automatically discovered.

Parameters

array $paths

Return Value

Kernel

in Kernel at line 37
protected array bootstrappers()

Get the bootstrap classes for the application.

Return Value

array

at line 24
protected void reportException(Throwable $e)

Report the exception to the exception handler.

Parameters

Throwable $e

Return Value

void

Exceptions

Throwable

in Kernel at line 568
protected void renderException(OutputInterface $output, Throwable $e)

Render the given exception.

Parameters

OutputInterface $output
Throwable $e

Return Value

void

in Kernel at line 584
int run(InputInterface|null $input = null, OutputInterface|null $output = null)

Runs the current application.

Parameters

InputInterface|null $input
OutputInterface|null $output

Return Value

int

0 if everything went fine, or an error code

Exceptions

Exception