X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FFileSystem.php;h=4de9384bb031991b2ab5437c08e8adb3db5a15fa;hb=fe442683efb8b75394d7df041716c47c81b05fbc;hp=33e04788e6921b184ad600f904300b2f2aea50e3;hpb=6b2c28e2d72d618bd46b9264f9e348725d7b5f5f;p=friendica.git diff --git a/src/Util/FileSystem.php b/src/Util/FileSystem.php index 33e04788e6..4de9384bb0 100644 --- a/src/Util/FileSystem.php +++ b/src/Util/FileSystem.php @@ -1,14 +1,43 @@ . + * + */ namespace Friendica\Util; -final class FileSystem +/** + * Util class for filesystem manipulation + */ +class FileSystem { /** * @var string a error message */ private $errorMessage; + /** + * Creates a directory based on a file, which gets accessed + * + * @param string $file The file + * + * @return string The directory name (empty if no directory is found, like urls) + */ public function createDir(string $file) { $dirname = null; @@ -39,6 +68,15 @@ final class FileSystem } } + /** + * Creates a stream based on a URL (could be a local file or a real URL) + * + * @param string $url The file/url + * + * @return resource the open stream rssource + * + * @throws \UnexpectedValueException + */ public function createStream(string $url) { $directory = $this->createDir($url);