本文整理汇总了PHP中League\Flysystem\FilesystemInterface::setVisibility方法的典型用法代码示例。如果您正苦于以下问题:PHP FilesystemInterface::setVisibility方法的具体用法?PHP FilesystemInterface::setVisibility怎么用?PHP FilesystemInterface::setVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类League\Flysystem\FilesystemInterface
的用法示例。
在下文中一共展示了FilesystemInterface::setVisibility方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setVisibility
/**
* @override
* @inheritDoc
*/
public function setVisibility($path, $visibility)
{
$ex = null;
$result = false;
try {
$result = $this->fs->setVisibility($path, $visibility);
} catch (Error $ex) {
} catch (Exception $ex) {
}
if (!$result || $ex !== null) {
throw new WriteException("File {$path} visibility could not be set to {$visibility}.", $ex);
}
}
示例2: save
/**
* {@inheritdoc}
*/
public function save($path, $content, $visibility = self::VISIBILITY_PRIVATE)
{
if (!$this->master->has($path)) {
// File creation: remove from backup if it existed and warm-up both master and backup
$this->createAndBackup($path, $content);
} else {
// File update: backup before writing
$this->backupAndUpdate($path, $content);
}
if ($this->enableBackup) {
$this->backup->setVisibility($path, $visibility);
}
$this->master->setVisibility($path, $visibility);
}
示例3: setVisibility
/**
* Set the visibility for the given path.
*
* @param string $path
* @param string $visibility
* @return void
*/
public function setVisibility($path, $visibility)
{
return $this->driver->setVisibility($path, $this->parseVisibility($visibility));
}
示例4: setPrivate
/**
* Sets visibility of file or directory to private.
*
* @param string $path
* @throws IoWriteException
*/
public function setPrivate($path = '')
{
if (!$this->fs->setVisibility($path, static::VISIBILITY_PRIVATE)) {
throw new IoWriteException("File {$path} visibility could not be set to private.");
}
}
示例5: setVisibility
/**
* Set the visibility for a file.
*
* @param string $path The path to the file.
* @param string $visibility One of 'public' or 'private'.
*
* @return bool True on success, false on failure.
*/
public function setVisibility($path, $visibility)
{
return $this->fileSystem->setVisibility($path, $visibility);
}