PHP Class PHPDaemon\FS\FileWatcher

Author: Vasily Zorin ([email protected])
Inheritance: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
Datei anzeigen Open project: kakserpom/phpdaemon

Public Properties

Property Type Description
$descriptors of inotify descriptors
$files Associative array of the files being observed
$inotify Resource returned by inotify_init()

Public Methods

Method Description
__construct ( ) Constructor
addWatch ( string $path, mixed $cb, integer $flags = null ) : true Adds your subscription on object in FS
onFileChanged ( string $path ) : void Called when file $path is changed
rmWatch ( string $path, mixed $cb ) : boolean Cancels your subscription on object in FS
watch ( ) : void Check the file system, triggered by timer

Method Details

__construct() public method

Constructor
public __construct ( )

addWatch() public method

Adds your subscription on object in FS
public addWatch ( string $path, mixed $cb, integer $flags = null ) : true
$path string Path
$cb mixed Callback
$flags integer Look inotify_add_watch()
return true

onFileChanged() public method

Called when file $path is changed
public onFileChanged ( string $path ) : void
$path string Path
return void

rmWatch() public method

Cancels your subscription on object in FS
public rmWatch ( string $path, mixed $cb ) : boolean
$path string Path
$cb mixed Callback
return boolean

watch() public method

Check the file system, triggered by timer
public watch ( ) : void
return void

Property Details

$descriptors public_oe property

of inotify descriptors
public $descriptors

$files public_oe property

Associative array of the files being observed
public $files

$inotify public_oe property

Resource returned by inotify_init()
public $inotify