abstract class AbstractDriver implements DriverInterface

Properties

protected Channel|null $stopSignal
protected bool $stopping

Methods

__construct(Option $option)

No description

bool
isDarwin()

Determine if the current OS is macOS.

void
stop()

Stop the active watch lifecycle.

bool
isStopping()

Determine whether the driver has been stopped.

void
watchAtInterval(float $seconds, callable $scan)

Run a polling scan until the driver is stopped.

array
resolveTargets(array $watchPaths)

Resolve configured watch paths to absolute targets.

array
groupWatchPathsByTarget(array $watchPaths)

Group watch paths by their resolved target.

array
existingTargets(array $targets)

Filter targets that currently exist.

array
exec(string $command)

Execute a shell command using Swoole's coroutine-aware exec.

string
shellArguments(array $arguments)

Escape a list of arguments for interpolation into a shell command.

Details

at line 19
__construct(Option $option)

No description

Parameters

Option $option

at line 26
bool isDarwin()

Determine if the current OS is macOS.

Return Value

bool

at line 34
void stop()

Stop the active watch lifecycle.

Return Value

void

at line 51
protected bool isStopping()

Determine whether the driver has been stopped.

The state may change while hooked I/O yields to another coroutine.

Return Value

bool

at line 59
protected void watchAtInterval(float $seconds, callable $scan)

Run a polling scan until the driver is stopped.

Parameters

float $seconds
callable $scan

Return Value

void

at line 96
protected array resolveTargets(array $watchPaths)

Resolve configured watch paths to absolute targets.

Parameters

array $watchPaths

Return Value

array

at line 116
protected array groupWatchPathsByTarget(array $watchPaths)

Group watch paths by their resolved target.

Parameters

array $watchPaths

Return Value

array

at line 137
protected array existingTargets(array $targets)

Filter targets that currently exist.

Parameters

array $targets

Return Value

array

at line 149
protected array exec(string $command)

Execute a shell command using Swoole's coroutine-aware exec.

Every interpolated argument must be escaped before it reaches this boundary.

Parameters

string $command

Return Value

array

at line 165
protected string shellArguments(array $arguments)

Escape a list of arguments for interpolation into a shell command.

Parameters

array $arguments

Return Value

string