INotifyStorage
Storage backend that support active notifications
Tags
Table of Contents
- NOTIFY_ADDED = 1
- NOTIFY_MODIFIED = 3
- NOTIFY_REMOVED = 2
- NOTIFY_RENAMED = 4
- listen() : mixed
- Start listening for update notifications
- notify() : INotifyHandler
- Start the notification handler for this storage
Constants
NOTIFY_ADDED
public
mixed
NOTIFY_ADDED
= 1
NOTIFY_MODIFIED
public
mixed
NOTIFY_MODIFIED
= 3
NOTIFY_REMOVED
public
mixed
NOTIFY_REMOVED
= 2
NOTIFY_RENAMED
public
mixed
NOTIFY_RENAMED
= 4
Methods
listen()
Start listening for update notifications
public
listen(string $path, callable $callback) : mixed
The provided callback will be called for every incoming notification with the following parameters
- int $type the type of update, one of the INotifyStorage::NOTIFY_* constants
- string $path the path of the update
- string $renameTarget the target of the rename operation, only provided for rename updates
Note that this call is blocking and will not exit on it's own, to stop listening for notifications return false
from the callback
Parameters
- $path : string
- $callback : callable
Tags
Return values
mixed —notify()
Start the notification handler for this storage
public
notify( $path) : INotifyHandler