Skip to content

S3FilesystemAdapter

ListableFilesystemInterface over S3Client (SigV4 REST client, no aws-sdk-php).

The path-to-key mapping, the error translation and the listing (paging ListObjectsV2, folding CommonPrefixes back into relative paths) live in ListableObjectStoreFilesystemAdapter, shared with the other object-store drivers; this class supplies the client and the provider name that appears in its messages.

final readonly class S3FilesystemAdapter extends ListableObjectStoreFilesystemAdapter

ExtendsListableObjectStoreFilesystemAdapter
SourceS3FilesystemAdapter.php

public function __construct(S3Client $client, string $keyPrefix = ''): mixed

ParameterTypeDescription
$clientS3Client
$keyPrefixstring

Returns mixed

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
delete()ObjectStoreFilesystemAdapterDeletes the object under $path.
exists()ObjectStoreFilesystemAdapterReports whether the store holds an object under $path.
lastModified()ObjectStoreFilesystemAdapterReturns the object’s modification time, taken from its Last-Modified metadata.
listContents()ListableObjectStoreFilesystemAdapter
read()ObjectStoreFilesystemAdapterReturns the body of the object stored under $path.
size()ObjectStoreFilesystemAdapterReturns the object’s size in bytes, taken from its Content-Length metadata.
write()ObjectStoreFilesystemAdapterStores $contents as the object under $path, replacing any existing object.