Nextcloud PHP API (stable18)

INotifyHandler

Provides access to detected changes in the storage by either actively listening or getting the list of changes that happened in the background

Tags
since
12.0.0

Table of Contents

getChanges()  : \OCP\Files\Notify\IChange[]
Get all changes detected since the start of the notify process or the last call to getChanges
listen()  : mixed
Start listening for update notifications
stop()  : mixed
Stop listening for changes

Methods

getChanges()

Get all changes detected since the start of the notify process or the last call to getChanges

public getChanges() : \OCP\Files\Notify\IChange[]
Tags
since
12.0.0
Return values
\OCP\Files\Notify\IChange[]

listen()

Start listening for update notifications

public listen(callable $callback) : mixed

The provided callback will be called for every incoming notification with the following parameters

  • IChange|IRenameChange $change

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
$callback : callable
Tags
since
12.0.0
Return values
mixed

stop()

Stop listening for changes

public stop() : mixed

Note that any pending changes will be discarded

Tags
since
12.0.0
Return values
mixed

Search results