public function addWatch($path, $cb, $flags = null)
    {
        $path = realpath($path);
        if (!isset($this->files[$path])) {
            $this->files[$path] = [];
            if ($this->inotify) {
                $this->descriptors[inotify_add_watch($this->inotify, $path, $flags ?: IN_MODIFY)] = $path;
            }
        }
        $this->files[$path][] = $cb;
        Timer::setTimeout('fileWatcher');
        return true;
    }
public function addWatch($path, $cb, $flags = null)
    {
        $path = realpath($path);
        if (!isset($this->files[$path])) {
            $this->files[$path] = [];
            if ($this->inotify) {
                $this->descriptors[inotify_add_watch($this->inotify, $path, $flags ?: IN_MODIFY)] = $path;
            }
        }
        $this->files[$path][] = $cb;
        Timer::setTimeout('fileWatcher');
        return true;
    }
public function addWatch ( $ path , $ cb , $ flags = null ) { $ path = realpath ( $ path ) ; if ( ! isset ( $ this -> files [ $ path ] ) ) { $ this -> files [ $ path ] = [ ] ; if ( $ this -> inotify ) { $ this -> descriptors [ inotify_add_watch ( $ this -> inotify , $ path , $ flags ? : IN_MODIFY ) ] = $ path ; } } $ this -> files [ $ path ] [ ] = $ cb ; Timer :: setTimeout ( 'fileWatcher' ) ; return true ; }
Adds your subscription on object in FS
@param  string $path Path
@param  mixed $cb Callback
@param  integer $flags Look inotify_add_watch()
@return true
Adds your subscription on object in FS