PHP Class App\Libraries\WatchRecord\InotifyWatchRecord

Inheritance: extends WatchRecord, implements App\Libraries\WatchRecord\WatchRecordInterface
Afficher le fichier Open project: phanan/koel

Méthodes publiques

Méthode Description
__construct ( $string ) InotifyWatchRecord constructor.
isDeleted ( ) : boolean Determine if the object has just been deleted or moved from our watched directory.
isDirectory ( )
isNewOrModified ( ) : boolean Determine if the object has just been created or modified.
parse ( $string ) Parse the inotifywait's output. The inotifywait command should be something like: $ inotifywait -rme move,close_write,delete --format "%e %w%f" $MEDIA_PATH.

Method Details

__construct() public méthode

public __construct ( $string )
$string

isDeleted() public méthode

Determine if the object has just been deleted or moved from our watched directory.
public isDeleted ( ) : boolean
Résultat boolean

isDirectory() public méthode

public isDirectory ( )

isNewOrModified() public méthode

For our purpose, we watch both the CREATE and the CLOSE_WRITE event, because some operating systems only support CREATE, but not CLOSE_WRITE and MOVED_TO. Additionally, a MOVED_TO (occurred after the object has been moved/renamed to another location **under our watched directory**) should be considered as "modified" also.
public isNewOrModified ( ) : boolean
Résultat boolean

parse() public méthode

Parse the inotifywait's output. The inotifywait command should be something like: $ inotifywait -rme move,close_write,delete --format "%e %w%f" $MEDIA_PATH.
public parse ( $string )
$string string The output string.