ScanFileDriver
class ScanFileDriver extends AbstractDriver
Properties
| protected Channel|null | $stopSignal | from AbstractDriver | |
| protected bool | $stopping | from AbstractDriver | |
| protected Filesystem | $filesystem | ||
| protected null|array<string, string> | $lastFileHashes |
Methods
No description
Run a polling scan until the driver is stopped.
Resolve configured watch paths to absolute targets.
Group watch paths by their resolved target.
Execute a shell command using Swoole's coroutine-aware exec.
Escape a list of arguments for interpolation into a shell command.
Compute hashes for all watched files.
Hash a watched file.
Details
at line 22
__construct(Option $option, StdoutLoggerInterface $logger, Filesystem|null $filesystem = null)
No description
in
AbstractDriver at line 26
bool
isDarwin()
Determine if the current OS is macOS.
in
AbstractDriver at line 34
void
stop()
Stop the active watch lifecycle.
in
AbstractDriver 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.
in
AbstractDriver at line 59
protected void
watchAtInterval(float $seconds, callable $scan)
Run a polling scan until the driver is stopped.
in
AbstractDriver at line 96
protected array
resolveTargets(array $watchPaths)
Resolve configured watch paths to absolute targets.
in
AbstractDriver at line 116
protected array
groupWatchPathsByTarget(array $watchPaths)
Group watch paths by their resolved target.
in
AbstractDriver at line 137
protected array
existingTargets(array $targets)
Filter targets that currently exist.
in
AbstractDriver 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.
in
AbstractDriver at line 165
protected string
shellArguments(array $arguments)
Escape a list of arguments for interpolation into a shell command.
at line 35
void
watch(Channel $channel)
Watch for file changes by polling file hashes.
at line 47
protected void
processFileHashes(Channel $channel, array $currentFileHashes)
Process a new file hash snapshot.
at line 92
protected array
getWatchFileHashes()
Compute hashes for all watched files.
at line 159
protected string|null
hashFile(string $path)
Hash a watched file.