PHP Class App\Libraries\WatchRecord\WatchRecord

Show file Open project: phanan/koel

Protected Properties

Property Type Description
$events array Array of the occurred events.
$input string For example, an inotifywatch record should have an input similar to "DELETE /var/www/media/song.mp3".
$path string Full path of the file/directory on which the event occurred.

Public Methods

Method Description
__construct ( $input ) WatchRecord constructor.
__toString ( )
getPath ( ) : string
isDirectory ( ) : boolean Determine if the object is a directory.
isFile ( ) : boolean Determine if the object is a file.

Protected Methods

Method Description
eventExists ( $event ) : boolean Check if a given event name exists in the event array.

Method Details

__construct() public method

WatchRecord constructor.
public __construct ( $input )
$input string The output from a watcher command (which is an input for our script)

__toString() public method

public __toString ( )

eventExists() protected method

Check if a given event name exists in the event array.
protected eventExists ( $event ) : boolean
$event string
return boolean

getPath() public method

public getPath ( ) : string
return string

isDirectory() public method

Determine if the object is a directory.
public isDirectory ( ) : boolean
return boolean

isFile() public method

Determine if the object is a file.
public isFile ( ) : boolean
return boolean

Property Details

$events protected property

Array of the occurred events.
protected array $events
return array

$input protected property

For example, an inotifywatch record should have an input similar to "DELETE /var/www/media/song.mp3".
protected string $input
return string

$path protected property

Full path of the file/directory on which the event occurred.
protected string $path
return string