Kernel
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
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.
Register a callback to be invoked when the command lifecycle duration exceeds a given amount of time.
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 a Closure based command with the application.
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.
Get the registered command instance with the given name, if any.
Bootstrap the application without booting service providers.
Determine if the kernel should discover commands.
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.
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.
in
Kernel at line 106
__construct(Application $app, Dispatcher $events)
No description
in
Kernel at line 126
Kernel
rerouteSymfonyCommandEvents()
| internal |
Re-route the Symfony command events to their Hypervel counterparts.
in
Kernel at line 165
int
handle(InputInterface $input, OutputInterface|null $output = null)
Run the console application.
in
Kernel at line 24
void
terminate(InputInterface $input, int $status)
Terminate the application.
in
Kernel at line 270
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.
in
Kernel at line 289
CarbonImmutable|null
commandStartedAt()
When the command being handled started.
in
Kernel at line 314
protected string|null
scheduleTimezone()
Get the timezone that should be used by default for scheduled events.
in
Kernel at line 324
protected string|null
scheduleCache()
Get the name of the cache store that should manage scheduling mutexes.
in
Kernel at line 332
void
commands()
Register the commands for the application.
in
Kernel at line 339
ClosureCommand
command(string $signature, Closure $callback)
Register a Closure based command with the application.
in
Kernel at line 355
void
load(array|string $paths)
Register all of the commands in the given directory.
in
Kernel at line 397
protected Finder
findCommands(array $paths)
Get the Finder instance for discovering command files.
in
Kernel at line 405
protected string
commandClassFromFile(SplFileInfo $file, string $namespace)
Extract the command class name from the given file path.
in
Kernel at line 417
void
registerCommand(Command $command)
Register the given command with the console application.
in
Kernel at line 427
int
call(string $command, array $parameters = [], OutputInterface|null $outputBuffer = null)
Run an Artisan console command by name.
in
Kernel at line 441
PendingDispatch
queue(string $command, array $parameters = [])
Queue the given console command.
in
Kernel at line 449
Command|null
findCommand(string $name)
Get the registered command instance with the given name, if any.
in
Kernel at line 459
array
all()
Get all of the commands registered with the console.
in
Kernel at line 469
string
output()
Get the output for the last run command.
in
Kernel at line 479
void
bootstrap()
Bootstrap the application for artisan commands.
in
Kernel at line 499
protected void
discoverCommands()
Discover the commands that should be automatically loaded.
in
Kernel at line 515
void
bootstrapWithoutBootingProviders()
Bootstrap the application without booting service providers.
at line 34
protected bool
shouldDiscoverCommands()
Determine if the kernel should discover commands.
in
Kernel at line 535
Application
getArtisan()
Get the Artisan application instance.
in
Kernel at line 560
void
setArtisan(Application|null $artisan)
Set the Artisan application instance.
in
Kernel at line 576
Kernel
addCommands(array $commands)
Set the Artisan commands provided by the application.
in
Kernel at line 590
Kernel
addCommandPaths(array $paths)
Set the paths that should have their Artisan commands automatically discovered.
in
Kernel at line 600
Kernel
addCommandRoutePaths(array $paths)
Set the paths that should have their Artisan "routes" automatically discovered.
in
Kernel at line 36
protected array
bootstrappers()
Get the bootstrap classes for the application.
at line 26
protected void
reportException(Throwable $e, array $context = [])
Report the exception to the exception handler.
in
Kernel at line 628
protected void
renderException(OutputInterface $output, Throwable $e)
Render the given exception.
in
Kernel at line 644
int
run(InputInterface|null $input = null, OutputInterface|null $output = null)
Runs the current application.