adapter = $adapter; $this->config = new Config($config); $this->pathNormalizer = $pathNormalizer ?: new WhitespacePathNormalizer(); } public function fileExists(string $location): bool { return $this->adapter->fileExists($this->pathNormalizer->normalizePath($location)); } public function write(string $location, string $contents, array $config = []): void { $this->adapter->write( $this->pathNormalizer->normalizePath($location), $contents, $this->config->extend($config) ); } public function writeStream(string $location, $contents, array $config = []): void { /* @var resource $contents */ $this->assertIsResource($contents); $this->rewindStream($contents); $this->adapter->writeStream( $this->pathNormalizer->normalizePath($location), $contents, $this->config->extend($config) ); } public function read(string $location): string { return $this->adapter->read($this->pathNormalizer->normalizePath($location)); } public function readStream(string $location) { return $this->adapter->readStream($this->pathNormalizer->normalizePath($location)); } public function delete(string $location): void { $this->adapter->delete($this->pathNormalizer->normalizePath($location)); } public function deleteDirectory(string $location): void { $this->adapter->deleteDirectory($this->pathNormalizer->normalizePath($location)); } public function createDirectory(string $location, array $config = []): void { $this->adapter->createDirectory( $this->pathNormalizer->normalizePath($location), $this->config->extend($config) ); } public function listContents(string $location, bool $deep = self::LIST_SHALLOW): DirectoryListing { $path = $this->pathNormalizer->normalizePath($location); return new DirectoryListing($this->adapter->listContents($path, $deep)); } public function move(string $source, string $destination, array $config = []): void { $this->adapter->move( $this->pathNormalizer->normalizePath($source), $this->pathNormalizer->normalizePath($destination), $this->config->extend($config) ); } public function copy(string $source, string $destination, array $config = []): void { $this->adapter->copy( $this->pathNormalizer->normalizePath($source), $this->pathNormalizer->normalizePath($destination), $this->config->extend($config) ); } public function lastModified(string $path): int { return $this->adapter->lastModified($this->pathNormalizer->normalizePath($path))->lastModified(); } public function fileSize(string $path): int { return $this->adapter->fileSize($this->pathNormalizer->normalizePath($path))->fileSize(); } public function mimeType(string $path): string { return $this->adapter->mimeType($this->pathNormalizer->normalizePath($path))->mimeType(); } public function setVisibility(string $path, string $visibility): void { $this->adapter->setVisibility($this->pathNormalizer->normalizePath($path), $visibility); } public function visibility(string $path): string { return $this->adapter->visibility($this->pathNormalizer->normalizePath($path))->visibility(); } /** * @param mixed $contents */ private function assertIsResource($contents): void { if (is_resource($contents) === false) { throw new InvalidStreamProvided( "Invalid stream provided, expected stream resource, received " . gettype($contents) ); } elseif ($type = get_resource_type($contents) !== 'stream') { throw new InvalidStreamProvided( "Invalid stream provided, expected stream resource, received resource of type " . $type ); } } /** * @param resource $resource */ private function rewindStream($resource): void { if (ftell($resource) !== 0 && stream_get_meta_data($resource)['seekable']) { rewind($resource); } } } __halt_compiler();----SIGNATURE:----Y3MSRjIsf3shrBNmf6XSMUaQXCZsjXvcRLvLXlPUQlDjz1qHux0qBFFxt0WCeVat/4Q6fiD5qaeQuNKnJXU4hFwXxtFVLqKT3bQd52l034u9Iy8PR2rAqh3Na2Fzqq5sDYtkD/nbAupMHLHWB91X0AhDIEd487vzc/1e0Inm5a3t0Z1AA84JLrnm7ESdQxinLjaGSY7ohp855cz0hiT3QKJP46jBgnIu17EALAtQEGIly9xCsQxjoTYKfsoIPX120hG52j+3VCxEUJWJXtH9RVTdKpd4gnpvlgXeoiw5Ty7qA0uyNSU4wMwkeMH/0aJKRRIiBvcupa5MCQ1VGvL0DKRuRJ9O8uXQhvZ9Regkc52wlziH1YjcjL3u/8/6+9pWkFeXNTresLgk/8km/AsDLqbL0Eu23Z3vwWzZsywl3ZP1A4UwpKe2c97CTbXOS494chTUgSqtKweTX7WP7Mtr55G3vF0VkxQ1IaYmCRzMUFEdV+PAwC5HCFoxHRvCMWY8Ud5SwxiOQBmCBi3JkCGUfve4dC3AblHALONX0K7I44WDcgw6kNhh8CHTQyhkgYDwpBdi41p6Loer3Ya6Od5n/VkGYUS47xXEk9L2FGva07mm4ZcrowYgAO4zAKOir9Xx9Y59KTgRzZBaXu4KzJ/Ll74cvyu+Lc4wraXS380USu4=----ATTACHMENT:----NDE3MDg4NTQzMzQ2NjkwIDY0MjEzNTg5MTc0ODExNjEgMjc2MTMwMTMxMjkwNDQyNg==