/home/techb158/immovalet.com/platform/core/base/src/Supports
NameSizeModeActions
Action.php9550644editdlrm
ActionHookEvent.php21360644editdlrm
Assets.php23640644editdlrm
Avatar.php88450644editdlrm
BaseSeeder.php14380644editdlrm
BreadcrumbsGenerator.php17290644editdlrm
BreadcrumbsManager.php49300644editdlrm
Core.php73240644editdlrm
CustomResourceRegistrar.php31050644editdlrm
DashboardMenu.php60210644editdlrm
Editor.php13410644editdlrm
EmailAbstract.php18170644editdlrm
EmailHandler.php115100644editdlrm
Enum.php55020644editdlrm
Filter.php13240644editdlrm
Gravatar.php5320644editdlrm
Helper.php71290644editdlrm
Language.php176930644editdlrm
MacroableModels.php37510644editdlrm
MembershipAuthorization.php27020644editdlrm
MetaBox.php87200644editdlrm
MountManager.php39940644editdlrm
PageTitle.php6680644editdlrm
PclZip.php2144990644editdlrm
RepositoryHelper.php8190644editdlrm
SortItemsWithChildrenHelper.php22810644editdlrm
SystemManagement.php41620644editdlrm
Edit: /home/techb158/immovalet.com/platform/core/base/src/Supports/MountManager.php (3994B)
Filesystem,] * @throws InvalidArgumentException */ public function __construct(array $filesystems = []) { $this->mountFilesystems($filesystems); } /** * Mount filesystems. * * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] * @return $this * @throws InvalidArgumentException */ public function mountFilesystems(array $filesystems) { foreach ($filesystems as $prefix => $filesystem) { $this->mountFilesystem($prefix, $filesystem); } return $this; } /** * Mount filesystems. * * @param string $prefix * @param FilesystemInterface $filesystem * @return $this * @throws InvalidArgumentException */ public function mountFilesystem($prefix, FilesystemInterface $filesystem) { if (!is_string($prefix)) { throw new InvalidArgumentException(__METHOD__ . ' expects argument #1 to be a string.'); } $this->filesystems[$prefix] = $filesystem; return $this; } /** * @param string $directory * @param bool $recursive * @return array * @throws FilesystemNotFoundException * @throws InvalidArgumentException */ public function listContents($directory = '', $recursive = false) { [$prefix, $directory] = $this->getPrefixAndPath($directory); $filesystem = $this->getFilesystem($prefix); $result = $filesystem->listContents($directory, $recursive); foreach ($result as &$file) { $file['filesystem'] = $prefix; } return $result; } /** * @param string $path * @return string[] [:prefix, :path] * @throws InvalidArgumentException */ protected function getPrefixAndPath($path) { if (strpos($path, '://') < 1) { throw new InvalidArgumentException('No prefix detected in path: ' . $path); } return explode('://', $path, 2); } /** * Get the filesystem with the corresponding prefix. * * @param string $prefix * @return FilesystemInterface * @throws FilesystemNotFoundException */ public function getFilesystem($prefix) { if (!isset($this->filesystems[$prefix])) { throw new FilesystemNotFoundException('No filesystem mounted with prefix ' . $prefix); } return $this->filesystems[$prefix]; } /** * Check whether a file exists. * * @param string $path * @return bool */ public function has($path) { [$prefix, $path] = $this->getPrefixAndPath($path); return $this->getFilesystem($prefix)->has($path); } /** * Read a file. * * @param string $path The path to the file. * @return string|false The file contents or false on failure. * @throws FileNotFoundException */ public function read($path) { [$prefix, $path] = $this->getPrefixAndPath($path); return $this->getFilesystem($prefix)->read($path); } /** * Create a file or update if exists. * * @param string $path The path to the file. * @param string $contents The file contents. * @param array $config An optional configuration array. * @return bool True on success, false on failure. */ public function put($path, $contents, array $config = []) { [$prefix, $path] = $this->getPrefixAndPath($path); return $this->getFilesystem($prefix)->put($path, $contents, $config); } }