Kernel
class Kernel implements Kernel
Traits
Properties
| protected EventDispatcher|null | $symfonyDispatcher | The Symfony event dispatcher implementation. |
|
| protected Application|null | $artisan | ||
| protected array | $commands | The Artisan commands provided by the application. |
|
| protected array | $commandPaths | The paths where Artisan commands should be automatically discovered. |
|
| protected array | $commandRoutePaths | The paths where Artisan "routes" should be automatically discovered. |
|
| protected bool | $commandsLoaded | Indicates if the Closure commands have been loaded. |
|
| protected array | $loadedPaths | The commands paths that have been "loaded". |
|
| protected Command>|Command> | $kernelCommands | The commands registered through the "load" and "command" methods. |
|
| protected array | $commandLifecycleDurationHandlers | All of the registered command duration handlers. |
|
| protected CarbonImmutable|null | $commandStartedAt | When the currently handled command started. |
|
| protected array | $bootstrappers | The console application bootstrappers. |
Methods
Get the number of seconds until the given DateTime.
Get the "available at" UNIX timestamp.
If the given value is an interval, convert it to a DateTime instance.
Given a start time, format the total run time for human readability.
Re-route the Symfony command events to their Hypervel counterparts.
Run the console application.
Terminate the application.
Register a callback to be invoked when the command lifecycle duration exceeds a given amount of time.
When the command being handled started.
Resolve a console schedule instance.
Get the timezone that should be used by default for scheduled events.
Get the name of the cache store that should manage scheduling mutexes.
Register the commands for the application.
Register all of the commands in the given directory.
Get the Finder instance for discovering command files.
Extract the command class name from the given file path.
Register the given command with the console application.
Run an Artisan console command by name.
Queue the given console command.
Get the registered command instance with the given name, if any.
Get all of the commands registered with the console.
Get the output for the last run command.
Bootstrap the application for artisan commands.
Discover the commands that should be automatically loaded.
Bootstrap the application without booting service providers.
Determine if the kernel should discover commands.
Get the Artisan application instance.
Set the Artisan commands provided by the application.
Set the paths that should have their Artisan commands automatically discovered.
Set the paths that should have their Artisan "routes" automatically discovered.
Get the bootstrap classes for the application.
Runs the current application.
Details
in
InteractsWithTime at line 17
protected int
secondsUntil(DateInterval|DateTimeInterface|int $delay)
Get the number of seconds until the given DateTime.
in
InteractsWithTime at line 29
protected int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)
Get the "available at" UNIX timestamp.
in
InteractsWithTime at line 47
protected DateTimeInterface|int
parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)
If the given value is an interval, convert it to a DateTime instance.
in
InteractsWithTime at line 63
protected int
currentTime()
Get the current system time as a UNIX timestamp.
in
InteractsWithTime at line 71
protected string
runTimeForHumans(float $startTime, float|null $endTime = null)
Given a start time, format the total run time for human readability.
at line 114
__construct(Application $app, Dispatcher $events)
No description
at line 135
Kernel
rerouteSymfonyCommandEvents()
| internal |
Re-route the Symfony command events to their Hypervel counterparts.
at line 174
int
handle(InputInterface $input, OutputInterface|null $output = null)
Run the console application.
at line 212
void
terminate(InputInterface $input, int $status)
Terminate the application.
at line 290
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.
at line 309
CarbonImmutable|null
commandStartedAt()
When the command being handled started.
at line 317
protected void
schedule(Schedule $schedule)
Define the application's command schedule.
at line 324
Schedule
resolveConsoleSchedule()
Resolve a console schedule instance.
at line 334
protected string|null
scheduleTimezone()
Get the timezone that should be used by default for scheduled events.
at line 344
protected string|null
scheduleCache()
Get the name of the cache store that should manage scheduling mutexes.
at line 352
protected void
commands()
Register the commands for the application.
at line 363
ClosureCommand
command(string $signature, Closure $callback)
Register a Closure based command with the application.
Commands remain registered for the kernel's lifetime.
at line 380
protected void
load(array|string $paths)
Register all of the commands in the given directory.
at line 420
protected Finder
findCommands(array $paths)
Get the Finder instance for discovering command files.
at line 428
protected string
commandClassFromFile(SplFileInfo $file, string $namespace)
Extract the command class name from the given file path.
at line 440
void
registerCommand(Command $command)
Register the given command with the console application.
at line 451
int
call(string $command, array $parameters = [], OutputInterface|null $outputBuffer = null)
Run an Artisan console command by name.
at line 465
PendingDispatch
queue(string $command, array $parameters = [])
Queue the given console command.
at line 473
Command|null
findCommand(string $name)
Get the registered command instance with the given name, if any.
at line 483
array
all()
Get all of the commands registered with the console.
at line 493
string
output()
Get the output for the last run command.
at line 503
void
bootstrap()
Bootstrap the application for artisan commands.
at line 523
protected void
discoverCommands()
Discover the commands that should be automatically loaded.
at line 539
void
bootstrapWithoutBootingProviders()
Bootstrap the application without booting service providers.
at line 551
protected bool
shouldDiscoverCommands()
Determine if the kernel should discover commands.
at line 559
Application
getArtisan()
Get the Artisan application instance.
at line 584
void
setArtisan(Application|null $artisan)
Set the Artisan application instance.
at line 602
Kernel
addCommands(array $commands)
Set the Artisan commands provided by the application.
at line 618
Kernel
addCommandPaths(array $paths)
Set the paths that should have their Artisan commands automatically discovered.
at line 630
Kernel
addCommandRoutePaths(array $paths)
Set the paths that should have their Artisan "routes" automatically discovered.
at line 640
protected array
bootstrappers()
Get the bootstrap classes for the application.
at line 650
protected void
reportException(Throwable $e, array $context = [])
Report the exception to the exception handler.
at line 658
protected void
renderException(OutputInterface $output, Throwable $e)
Render the given exception.
at line 674
int
run(InputInterface|null $input = null, OutputInterface|null $output = null)
Runs the current application.