/** * {@inheritdoc} */ public function symlink($target, $link) { $this->reactor->addRef(); $promisor = new Deferred(); uv_fs_symlink($this->loop, $target, $link, \UV::S_IRWXU | \UV::S_IRUSR, function ($fh) use($promisor) { $this->reactor->delRef(); $promisor->succeed((bool) $fh); }); return $promisor->promise(); }
/** * @todo * @param string $sourcePath * @param string $sestinationPath * @param callable $callback * @param int $flags * @return $this */ public function symlink($sourcePath, $sestinationPath, callable $callback, $flags = null) { $self = $this; \uv_fs_symlink($this->getLoop()->getBackend(), $sourcePath, $sestinationPath, function ($fd) use($callback, $self) { $callback($self, $fd); }, $flags); return $this; }