/** * This method is called to set metadata on the stream. It is called when one of the following functions is called on a stream URL: * - touch() * - chmod() * - chown() * - chgrp() * * Changes stream options * * @param String $path * @param Integer $option * @param mixed $var * @return bool * @access public */ public function stream_metadata($path, $option, $var) { $connection = $this->stream_open($path, NULL, NULL, $opened_path); if ($connection === false) { return FALSE; } switch ($option) { case 1: // PHP_STREAM_META_TOUCH $touch = $this->sftp->touch($this->path, $var[1], $var[0]); $this->stream_close(); return $touch; case 2: // PHP_STREAM_META_OWNER_NAME $this->stream_close(); return FALSE; case 3: // PHP_STREAM_META_OWNER $chown = $this->sftp->chown($this->path, $var); $this->stream_close(); return $chown; case 4: // PHP_STREAM_META_GROUP_NAME $this->stream_close(); return FALSE; case 5: // PHP_STREAM_META_GROUP $chgrp = $this->sftp->chgrp($this->path, $var); $this->stream_close(); return $chgrp; case 6: // PHP_STREAM_META_ACCESS $chmod = $this->sftp->chmod($var, $this->path); $this->stream_close(); return $chmod; default: $this->stream_close(); return FALSE; } }