FindDriver
class FindDriver extends AbstractDriver
Properties
| protected Channel|null | $stopSignal | from AbstractDriver | |
| protected bool | $stopping | from AbstractDriver | |
| protected list<string> | $referenceFiles | ||
| protected int | $activeReferenceIndex | ||
| protected array<string, true> | $inventory | ||
| protected bool | $hasCompleteInventory |
Methods
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.
Scan watched targets for changed and currently live files.
Report the guarantees affected by a degraded scan cycle.
Run one changed-file or inventory traversal.
Parse complete matching paths from NUL-delimited command output.
Reconcile changed files with the latest complete or partial inventory.
Ensure this lifecycle owns two unique reference files.
Create a unique reference file.
Update a reference file to the current filesystem timestamp.
Return the reference that bounds the current changed traversal.
Return the reference that will bound the next changed traversal.
Make the pre-recorded next cutoff authoritative.
Remove every reference file owned by this lifecycle.
Details
at line 26
__construct(Option $option, StdoutLoggerInterface $logger)
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 40
void
watch(Channel $channel)
Watch for file changes using find -newer.
at line 98
protected array
scan()
Scan watched targets for changed and currently live files.
at line 148
protected void
logDegradedCycle(int $failureCode, bool $changedComplete, bool $inventoryComplete)
Report the guarantees affected by a degraded scan cycle.
at line 174
protected array
find(array $targets, bool $recursive, bool $changed)
Run one changed-file or inventory traversal.
at line 196
protected array
matchingFiles(string $output)
Parse complete matching paths from NUL-delimited command output.
at line 233
protected array
reconcileInventory(array $changedFiles, array $currentInventory, bool $inventoryComplete)
Reconcile changed files with the latest complete or partial inventory.
at line 265
protected void
ensureReferenceFiles()
Ensure this lifecycle owns two unique reference files.
at line 281
protected string
createReferenceFile()
Create a unique reference file.
at line 295
protected void
updateReferenceFile(string $path)
Update a reference file to the current filesystem timestamp.
at line 305
protected string
activeReferenceFile()
Return the reference that bounds the current changed traversal.
at line 313
protected string
inactiveReferenceFile()
Return the reference that will bound the next changed traversal.
at line 321
protected void
rotateReferenceFiles()
Make the pre-recorded next cutoff authoritative.
at line 329
protected void
removeReferenceFiles()
Remove every reference file owned by this lifecycle.