class FindDriver extends AbstractDriver

Properties

protected Channel|null $stopSignal from  AbstractDriver
protected bool $stopping from  AbstractDriver
protected bool $supportsFractionalMinutes
protected int $startTime
protected array $fileModifyTimes

Methods

__construct(Option $option, StdoutLoggerInterface $logger)

No description

bool
isDarwin()

Determine if the current OS is macOS.

void
stop()

Stop the active watch lifecycle.

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
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.

void
watch(Channel $channel)

Watch for file changes using the find command.

string
getScanIntervalMinutes()

Get the scan interval as a find -mmin compatible minutes string.

array
find(array $fileModifyTimes, array $targets, string $minutes)

Find changed files in the given targets using the find command.

string
getBin()

Get the find binary name for the current OS.

array
scan(array $fileModifyTimes, string $minutes)

Scan watched directories and files for changes.

Details

at line 20
__construct(Option $option, StdoutLoggerInterface $logger)

No description

Parameters

Option $option
StdoutLoggerInterface $logger

in AbstractDriver at line 26
bool isDarwin()

Determine if the current OS is macOS.

Return Value

bool

in AbstractDriver at line 34
void stop()

Stop the active watch lifecycle.

Return Value

void

in AbstractDriver at line 47
protected void watchAtInterval(float $seconds, callable $scan)

Run a polling scan until the driver is stopped.

Parameters

float $seconds
callable $scan

Return Value

void

in AbstractDriver at line 80
protected array resolveTargets(array $watchPaths)

Resolve configured watch paths to absolute targets.

Parameters

array $watchPaths

Return Value

array

in AbstractDriver at line 100
protected array existingTargets(array $targets)

Filter targets that currently exist.

Parameters

array $targets

Return Value

array

in AbstractDriver at line 112
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

in AbstractDriver at line 128
protected string shellArguments(array $arguments)

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

Parameters

array $arguments

Return Value

string

at line 45
void watch(Channel $channel)

Watch for file changes using the find command.

Parameters

Channel $channel

Return Value

void

at line 62
protected string getScanIntervalMinutes()

Get the scan interval as a find -mmin compatible minutes string.

Return Value

string

at line 77
protected array find(array $fileModifyTimes, array $targets, string $minutes)

Find changed files in the given targets using the find command.

Parameters

array $fileModifyTimes
array $targets
string $minutes

Return Value

array

at line 107
protected string getBin()

Get the find binary name for the current OS.

Return Value

string

at line 115
protected array scan(array $fileModifyTimes, string $minutes)

Scan watched directories and files for changes.

Parameters

array $fileModifyTimes
string $minutes

Return Value

array