<?php uv_fs_chmod(uv_default_loop(), "moe", 0777, function ($result) { var_dump($result); }); uv_run();
/** * {@inheritdoc} */ public function chmod($path, $mode) { $this->reactor->addRef(); $promisor = new Deferred(); \uv_fs_chmod($this->loop, $path, $mode, function ($fh) use($promisor) { $this->reactor->delRef(); $promisor->succeed((bool) $fh); }); return $promisor->promise(); }
/** * Change the mode of a file/directory by path * * @param string $path * @param int $mode * @param callable $callback * @return $this */ public function chmod($path, $mode, callable $callback = null) { $self = $this; \uv_fs_chmod($this->getLoop()->getBackend(), $path, $mode, function ($fd) use($callback, $self) { if ($callback === null) { return; } $callback($self, $fd); }); return $this; }