本文整理匯總了PHP中Net_SFTP::chown方法的典型用法代碼示例。如果您正苦於以下問題:PHP Net_SFTP::chown方法的具體用法?PHP Net_SFTP::chown怎麽用?PHP Net_SFTP::chown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Net_SFTP
的用法示例。
在下文中一共展示了Net_SFTP::chown方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stream_metadata
/**
* 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;
}
}