Nextcloud PHP API (stable18)

INotifyStorage

Storage backend that support active notifications

Tags
since
9.1.0

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

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
since
9.1.0
deprecated
12.0.0

use INotifyStorage::notify()->listen() instead

Return values
mixed

Search results