Skip to content

ListableObjectStoreFilesystemAdapter

A ListableFilesystemInterface over any ListableObjectStoreClientInterface, everything but listing inherited unchanged from ObjectStoreFilesystemAdapter.

ListableObjectStoreFilesystemAdapter::listContents() treats $path the way a filesystem does even though the store underneath is flat: it lists with a / delimiter at the key one level below $path, so a deeper key never surfaces as if it were a direct child, then folds the store’s own pagination away — a caller gets one full, sorted list rather than having to drive continuation tokens itself. A prefix that groups into a “directory” comes back as a bare relative path, exactly like a subdirectory from LocalFilesystemAdapter::listContents(), not with its trailing delimiter.

A second, separately-typed reference to the same client this class was constructed with: ObjectStoreFilesystemAdapter::$client cannot be redeclared with a narrower type in PHP (property types are invariant across inheritance), so the listing-capable view of the identical object lives here instead.

readonly class ListableObjectStoreFilesystemAdapter extends ObjectStoreFilesystemAdapter implements ListableFilesystemInterface

ExtendsObjectStoreFilesystemAdapter
ImplementsListableFilesystemInterface
Since4.2.0
SourceListableObjectStoreFilesystemAdapter.php

public function __construct(ListableObjectStoreClientInterface $listableClient, string $providerName, string $keyPrefix = ''): mixed

Prepended to every path to form the object key.

ParameterTypeDescription
$listableClientListableObjectStoreClientInterface
$providerNamestringNamed in error messages, e.g. ‘S3’, ‘GCS’, ‘Azure’.
$keyPrefixstringPrepended to every path to form the object key.

Returns mixed

MethodDescription
listContents(string $path = ''): list<string>The entries directly under $path.

public function listContents(string $path = ''): list<string>

The entries directly under $path.

ParameterTypeDescription
$pathstring

Returns list``<``string``> — Relative paths, non-recursive.

ThrowsWhen
FilesystemStorageExceptionIf the store call itself failed.

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.
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.