PHPDaemon\FS\FileWatcher::rmWatch PHP Method

rmWatch() public method

Cancels your subscription on object in FS
public rmWatch ( string $path, mixed $cb ) : boolean
$path string Path
$cb mixed Callback
return boolean
    public function rmWatch($path, $cb)
    {
        $path = realpath($path);
        if (!isset($this->files[$path])) {
            return false;
        }
        if (($k = array_search($cb, $this->files[$path], true)) !== false) {
            unset($this->files[$path][$k]);
        }
        if (sizeof($this->files[$path]) === 0) {
            if ($this->inotify) {
                if (($descriptor = array_search($path, $this->descriptors)) !== false) {
                    inotify_rm_watch($this->inotify, $cb);
                }
            }
            unset($this->files[$path]);
        }
        return true;
    }