/** * {@inheritdoc} */ public function getFileMode($file) { $visibility = $this->filesystem->getVisibility($file); if ($visibility) { return $visibility == AdapterInterface::VISIBILITY_PRIVATE ? 0700 : 0744; } else { return false; } }
/** * Get the visibility for the given path. * * @param string $path * @return string */ public function getVisibility($path) { if (parent::getVisibility($path) == AdapterInterface::VISIBILITY_PUBLIC) { return FilesystemInterface::VISIBILITY_PUBLIC; } return FilesystemInterface::VISIBILITY_PRIVATE; }
/** * @inheritdoc */ public function getVisibility($path) { try { return $this->fileSystem->getVisibility($this->getInnerPath($path)); } catch (FileNotFoundException $e) { throw $this->exceptionWrapper($e, $path); } }
/** * Get a file's visibility * * ```php * getVisibility('cache/file.tmp') * getVisibility('~/file.tmp$/') * ``` * * @param string $path path to file or regexp pattern * @return string|false visibility (public|private) or FALSE * when fails to check it in existing file */ public function getVisibility($path) { if (StringHelper::isRegexp($path) && !($path = $this->searchByPattern($path))) { return false; } try { return parent::getVisibility($path); } catch (\Exception $e) { $this->errors[] = $e->getMessage(); } return false; }