DevCommands
class DevCommands
Constants
| protected DEFAULT_MODE |
|
Properties
| static protected NodePackageManager|null | $packageManager | The resolved NodePackageManager instance. |
|
| static protected int | $colorCount | Counter to keep track of how many colors have been assigned. |
|
| static protected DevCommand> | $commands | The registered development commands. |
|
| static protected list<string> | $only | The names of commands that should be included when running the "dev" command. |
|
| static protected list<string> | $except | The names of commands that should be excluded when running the "dev" command. |
|
| static protected array<int, string> | $order | The order in which named commands should run when running the "dev" command. |
|
| static protected DevCommandMode | $mode | The mode in which the "dev" command should run. |
|
| static protected bool | $withTimestamps | Whether to include timestamps in the output of the "dev" command. |
|
| static protected bool | $autoRestart | Whether to automatically restart a "dev" command when it fails. |
|
| static protected bool | $withoutVendorCommands | Whether to exclude vendor commands. |
|
| static protected bool | $withoutDefaultCommands | Whether to exclude the framework's default commands. |
|
| static protected int|null | $bufferSize | How many lines of output to buffer for each command when running in tabbed mode. |
|
| static protected int|null | $streamBufferSize | How many lines of output to buffer total when running in stream mode. |
Methods
Register the default development commands.
Register a development command.
Register an Artisan command, automatically prefixing it with "php artisan".
Register a Node command, automatically prefixing it with the detected package manager's run command.
Register a Node command, automatically prefixing it with the detected package manager's exec command.
Get the registered development commands.
Set the mode to inline, where all commands are run in the same terminal window.
Set the mode to stream, where all commands are run in the same terminal window, but their output is interactive within a TUI.
Set the mode to tabs, where each command is run in its own terminal tab.
Get the mode in which the "dev" command should run.
Enable timestamps in the output of the "dev" command.
Determine if timestamps should be included in the output of the "dev" command.
Disable automatic restart of a "dev" command when it fails.
Determine if a "dev" command should automatically restart when it fails.
Set the number of lines of output to buffer for each command when running in tabbed mode.
Get the number of lines of output to buffer for each command when running in tabbed mode.
Set the number of lines of output to buffer total when running in stream mode.
Get the number of lines of output to buffer total when running in stream mode.
Sort the given commands.
Fill in any empty colors in the given commands array, ensuring each command has a color assigned.
Get a color for a command, ensuring that colors are reused only after all available colors have been used at least once.
Resolve the first external caller frame from a debug backtrace.
Determine the registration priority from a debug backtrace.
Determine whether a file belongs to an installed Composer dependency.
Determine whether a path is the given directory or one of its descendants.
Set the commands that should be included when running the "dev" command.
Set the commands that should be excluded when running the "dev" command.
Set the order in which named commands should run when running the "dev" command.
Exclude any commands from the vendor directory.
Exclude the framework's default commands.
Resolve and return the NodePackageManager instance.
Flush all static state.
Details
at line 103
static void
registerDefaults()
Register the default development commands.
The commands persist in static properties for the worker lifetime and affect every subsequent development command invocation.
at line 125
static DevCommand
register(string $command, string|null $name = null)
Register a development command.
The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 153
static DevCommand
artisan(string $command, string|null $name = null)
Register an Artisan command, automatically prefixing it with "php artisan".
The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 165
static DevCommand
node(string $command, string|null $name = null)
Register a Node command, automatically prefixing it with the detected package manager's run command.
The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 177
static DevCommand
nodeExec(string $command, string|null $name = null)
Register a Node command, automatically prefixing it with the detected package manager's exec command.
The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 188
static array
commands()
Get the registered development commands.
at line 220
static void
inline()
Set the mode to inline, where all commands are run in the same terminal window.
The mode is shared by all development command invocations in the worker.
at line 231
static void
stream()
Set the mode to stream, where all commands are run in the same terminal window, but their output is interactive within a TUI.
The mode is shared by all development command invocations in the worker.
at line 242
static void
tabs()
Set the mode to tabs, where each command is run in its own terminal tab.
The mode is shared by all development command invocations in the worker.
at line 251
static DevCommandMode
mode()
Get the mode in which the "dev" command should run.
at line 261
static void
withTimestamps()
Enable timestamps in the output of the "dev" command.
The setting is shared by all development command invocations in the worker.
at line 270
static bool
shouldIncludeTimestamps()
Determine if timestamps should be included in the output of the "dev" command.
at line 280
static void
disableAutoRestart()
Disable automatic restart of a "dev" command when it fails.
The setting is shared by all development command invocations in the worker.
at line 289
static bool
shouldAutoRestart()
Determine if a "dev" command should automatically restart when it fails.
at line 299
static void
bufferSize(int $lines)
Set the number of lines of output to buffer for each command when running in tabbed mode.
The buffer size is shared by all development command invocations in the worker.
at line 308
static int|null
getBufferSize()
Get the number of lines of output to buffer for each command when running in tabbed mode.
at line 318
static void
streamBufferSize(int $lines)
Set the number of lines of output to buffer total when running in stream mode.
The buffer size is shared by all development command invocations in the worker.
at line 327
static int|null
getStreamBufferSize()
Get the number of lines of output to buffer total when running in stream mode.
at line 338
static protected array
applyOrder(array $commands)
Sort the given commands.
at line 357
static protected array
fillInEmptyColors(array $commands)
Fill in any empty colors in the given commands array, ensuring each command has a color assigned.
at line 373
static protected string
getColor(array $commands)
Get a color for a command, ensuring that colors are reused only after all available colors have been used at least once.
at line 389
static protected array
resolveSource(array $trace)
Resolve the first external caller frame from a debug backtrace.
at line 412
static protected int
resolvePriority(array $trace)
Determine the registration priority from a debug backtrace.
at line 453
static protected bool
isDependencyFile(string $file)
Determine whether a file belongs to an installed Composer dependency.
at line 479
static protected bool
isWithinPath(string $path, string $directory)
Determine whether a path is the given directory or one of its descendants.
at line 490
static void
only(string ...$names)
Set the commands that should be included when running the "dev" command.
The filter persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 502
static void
except(string ...$names)
Set the commands that should be excluded when running the "dev" command.
The filter persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 515
static void
order(array $names)
Set the order in which named commands should run when running the "dev" command.
The order is shared by all development command invocations in the worker.
at line 526
static void
withoutVendorCommands()
Exclude any commands from the vendor directory.
The filter is shared by all development command invocations in the worker.
at line 537
static void
withoutDefaultCommands()
Exclude the framework's default commands.
The filter is shared by all development command invocations in the worker.
at line 546
static protected NodePackageManager
getPackageManager()
Resolve and return the NodePackageManager instance.
at line 554
static void
flushState()
Flush all static state.