Skip to content

Commit 7c6eb44

Browse files
committed
keep libuv doc/stubs in sync with [WIP] PR amphp/ext-uv#77
1 parent d8260c9 commit 7c6eb44

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

Spawn/UVFunctions.php

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,12 +1849,44 @@ function uv_fs_readdir(UVLoop $loop, string $path, int $flags, callable $callbac
18491849
}
18501850

18511851
/**
1852-
* Initialize fs event.
1852+
* Initialize file change event `UVFsEvent` handle, and start the given callback.
1853+
* This will watch the specified path for changes. `$flags` can be an ORed mask of `uv_fs_event_flags`.
1854+
*
1855+
* The callback will receive the following arguments:
1856+
*
1857+
* `handle` - `UVFsEvent` handle. The path field of the handle is the file on which the watch was set.
1858+
* `filename` - If a directory is being monitored, this is the file which was changed. Only non-null on
1859+
* Linux and Windows. May be null even on those platforms.
1860+
* `events` - one of `UV::RENAME` or `UV::CHANGE`, or a bitwise OR of both.
1861+
* `status` - Currently 0, or `error` if < 0.
18531862
*
18541863
* @param UVLoop $loop uv loop handle
18551864
* @param string $path
18561865
* @param callable $callback callback expects (UVFsEvent $handle, ?string $filename, int $events, int $status).
1857-
* @param int $flags
1866+
*
1867+
* @param int $flags - `uv_fs_event_flags` that can be passed to control its behavior.
1868+
*
1869+
* By default, if the fs event watcher is given a directory name, we will
1870+
* watch for all events in that directory. This flags overrides this behavior
1871+
* and makes fs_event report only changes to the directory entry itself. This
1872+
* flag does not affect individual files watched.
1873+
* This flag is currently not implemented yet on any backend.
1874+
*
1875+
* `UV_FS_EVENT_WATCH_ENTRY = 1`
1876+
*
1877+
* By default uv_fs_event will try to use a kernel interface such as inotify
1878+
* or kqueue to detect events. This may not work on remote file systems such
1879+
* as NFS mounts. This flag makes fs_event fall back to calling stat() on a
1880+
* regular interval.
1881+
* This flag is currently not implemented yet on any backend.
1882+
*
1883+
* `UV_FS_EVENT_STAT = 2`
1884+
*
1885+
* By default, event watcher, when watching directory, is not registering
1886+
* (is ignoring) changes in its subdirectories.
1887+
* This flag will override this behaviour on platforms that support it.
1888+
*
1889+
* `UV_FS_EVENT_RECURSIVE = 4`
18581890
*
18591891
* @return UVFsEvent
18601892
*/

Spawn/UVHandles.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ final class UVLock
215215
* if the file was renamed or there was a generic change in it.
216216
*
217217
* This handle uses the best backend for the job on each platform.
218+
*
219+
* `inotify` on Linux.
220+
*
221+
* `FSEvents` on Darwin.
222+
*
223+
* `kqueue` on BSDs.
224+
*
225+
* `ReadDirectoryChangesW` on Windows.
226+
*
227+
* `event ports` on Solaris.
228+
*
229+
* `unsupported` on Cygwin
218230
*/
219231
final class UVFsEvent extends UV
220232
{

0 commit comments

Comments
 (0)