FindNewerDriver
class FindNewerDriver extends AbstractDriver
Properties
| protected Channel|null | $stopSignal | from AbstractDriver | |
| protected bool | $stopping | from AbstractDriver | |
| protected list<string> | $referenceFiles | ||
| protected bool | $scanning | ||
| protected int | $count |
Methods
Stop watching and remove this driver's reference files.
Run a polling scan until the driver is stopped.
Resolve configured watch paths to absolute targets.
Execute a shell command using Swoole's coroutine-aware exec.
Escape a list of arguments for interpolation into a shell command.
Find files newer than the reference file in the given targets.
Scan watched directories and files for changes.
Get the path to the reference file to be modified.
Get the path to the reference file used for scanning.
Ensure this driver owns two reference files for change comparisons.
Create a unique reference file owned by this driver.
Create or update a reference file used by find -newer.
Remove every reference file currently owned by this driver.
Details
at line 23
__construct(Option $option, StdoutLoggerInterface $logger)
No description
in
AbstractDriver at line 26
bool
isDarwin()
Determine if the current OS is macOS.
at line 98
void
stop()
Stop watching and remove this driver's reference files.
in
AbstractDriver at line 47
protected void
watchAtInterval(float $seconds, callable $scan)
Run a polling scan until the driver is stopped.
in
AbstractDriver at line 80
protected array
resolveTargets(array $watchPaths)
Resolve configured watch paths to absolute targets.
in
AbstractDriver at line 100
protected array
existingTargets(array $targets)
Filter targets that currently exist.
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.
in
AbstractDriver at line 128
protected string
shellArguments(array $arguments)
Escape a list of arguments for interpolation into a shell command.
at line 39
void
watch(Channel $channel)
Watch for file changes using find -newer.
at line 112
protected array
find(array $targets)
Find files newer than the reference file in the given targets.
at line 146
protected array
scan()
Scan watched directories and files for changes.
The coroutine-aware find command may yield while stop state changes.
at line 193
protected string
getToModifyFile()
Get the path to the reference file to be modified.
at line 201
protected string
getToScanFile()
Get the path to the reference file used for scanning.
at line 209
protected void
ensureReferenceFiles()
Ensure this driver owns two reference files for change comparisons.
at line 225
protected string
createReferenceFile()
Create a unique reference file owned by this driver.
at line 239
protected void
updateReferenceFile(string $path)
Create or update a reference file used by find -newer.
at line 249
protected void
removeReferenceFiles()
Remove every reference file currently owned by this driver.