/** * @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); } }
/** * {@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); }
/** * 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)); }
/** * 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."); } }
/** * 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); }