Public Member Functions | Protected Attributes

log2command_file_monitor Class Reference

Monitors files for activity. More...

Inheritance diagram for log2command_file_monitor:
log2command_base

List of all members.

Public Member Functions

 activity ($events)
 Process inotify events.
 add ($filename, $callback)
 Add a new file to monitor, together with its callback.
 cron ()
 Called by the main class to give the file monitor a chance to query inotify.
 remove ($filename)
 Remove a file watch.

Protected Attributes

 $files
 $inited = false
 $inotify

Detailed Description

Monitors files for activity.

Author:
Edward Plainview <it@sverigedemokraterna.se>

Member Function Documentation

add ( filename,
callback 
)

Add a new file to monitor, together with its callback.

Parameters:
$filename Full path to file.
$callback Callback to call when the file has been modified.
cron (  ) 

Called by the main class to give the file monitor a chance to query inotify.

Can be called as often or as seldom as needed. Will only block if there is activity on the watched files.

remove ( filename  ) 

Remove a file watch.

Parameters:
$filename Watch's file name.

Member Data Documentation

$files [protected]
$inited = false [protected]

Is the file monitor initialized?

$inotify [protected]

inotify object.


The documentation for this class was generated from the following file:
 All Classes Functions Variables