Kernel
abstract class Kernel extends Kernel
Base testbench console kernel with empty bootstrappers.
The testbench test lifecycle calls bootstrappers manually (via resolveApplicationBootstrappers) so it can insert defineEnvironment() between RegisterProviders and BootProviders. This kernel returns an empty bootstrapper list so that ConsoleKernel::bootstrap() — called at the end of the lifecycle — sets hasBeenBootstrapped without re-running any bootstrappers.
Traits
Properties
| protected EventDispatcher|null | $symfonyDispatcher | The Symfony event dispatcher implementation. |
from Kernel |
| protected Application|null | $artisan | from Kernel | |
| protected array | $commands | The Artisan commands provided by the application. |
from Kernel |
| 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.
Terminate the 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.
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.
Get the bootstrap classes for the 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 41
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 57
protected int
currentTime()
Get the current system time as a UNIX timestamp.
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.
in
Kernel at line 104
__construct(Application $app, Dispatcher $events)
No description
in
Kernel at line 124
Kernel
rerouteSymfonyCommandEvents()
| internal |
Re-route the Symfony command events to their Hypervel counterparts.
in
Kernel at line 155
int
handle(InputInterface $input, OutputInterface|null $output = null)
Run the console application.
at line 25
void
terminate(InputInterface $input, int $status)
Terminate the application.
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.
in
Kernel at line 247
CarbonImmutable|null
commandStartedAt()
When the command being handled started.
in
Kernel at line 272
protected string|null
scheduleTimezone()
Get the timezone that should be used by default for scheduled events.
in
Kernel at line 282
protected string|null
scheduleCache()
Get the name of the cache store that should manage scheduling mutexes.
in
Kernel at line 292
void
commands()
Register the commands for the application.
in
Kernel at line 299
ClosureCommand
command(string $signature, Closure $callback)
Register a Closure based command with the application.
in
Kernel at line 315
void
load(array|string $paths)
Register all of the commands in the given directory.
in
Kernel at line 357
protected Finder
findCommands(array $paths)
Get the Finder instance for discovering command files.
in
Kernel at line 365
protected string
commandClassFromFile(SplFileInfo $file, string $namespace)
Extract the command class name from the given file path.
in
Kernel at line 377
void
registerCommand(Command $command)
Register the given command with the console application.
in
Kernel at line 387
int
call(string $command, array $parameters = [], OutputInterface|null $outputBuffer = null)
Run an Artisan console command by name.
in
Kernel at line 401
PendingDispatch
queue(string $command, array $parameters = [])
Queue the given console command.
in
Kernel at line 409
array
all()
Get all of the commands registered with the console.
in
Kernel at line 419
string
output()
Get the output for the last run command.
in
Kernel at line 429
void
bootstrap()
Bootstrap the application for artisan commands.
in
Kernel at line 449
protected void
discoverCommands()
Discover the commands that should be automatically loaded.
in
Kernel at line 465
void
bootstrapWithoutBootingProviders()
Bootstrap the application without booting service providers.
at line 45
protected bool
shouldDiscoverCommands()
Determine if the kernel should discover commands.
in
Kernel at line 485
Application
getArtisan()
Get the Artisan application instance.
in
Kernel at line 510
void
setArtisan(Application|null $artisan)
Set the Artisan application instance.
in
Kernel at line 518
Kernel
addCommands(array $commands)
Set the Artisan commands provided by the application.
in
Kernel at line 532
Kernel
addCommandPaths(array $paths)
Set the paths that should have their Artisan commands automatically discovered.
in
Kernel at line 542
Kernel
addCommandRoutePaths(array $paths)
Set the paths that should have their Artisan "routes" automatically discovered.
at line 37
protected array
bootstrappers()
Get the bootstrap classes for the application.
in
Kernel at line 560
protected void
reportException(Throwable $e)
Report the exception to the exception handler.
in
Kernel at line 568
protected void
renderException(OutputInterface $output, Throwable $e)
Render the given exception.
in
Kernel at line 584
int
run(InputInterface|null $input = null, OutputInterface|null $output = null)
Runs the current application.