本文整理匯總了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);
}