class FilesystemOperatorAdapter implements FilesystemOperator

internal  
 

Adapt operation-scoped access to a Flysystem operator.

Methods

__construct(Closure $operation, Closure $stream, Closure|null $range = null)

Create an operator with separately owned stream lifetimes.

bool
fileExists(string $location)

Determine if a file exists.

bool
directoryExists(string $location)

Determine if a directory exists.

bool
has(string $location)

Determine if a file or directory exists.

string
read(string $location)

Read a file.

mixed
readStream(string $location)

Open a stream that retains any required lease until closure.

mixed
readStreamRange(string $path, int|null $start, int|null $end)

Open a native ranged stream, or return null when ranges are unsupported.

DirectoryListing
listContents(string $location, bool $deep = self::LIST_SHALLOW)

List contents without holding a lease while the caller processes entries.

int
lastModified(string $path)

Get a file's last modification time.

int
fileSize(string $path)

Get a file's size.

string
mimeType(string $path)

Get a file's MIME type.

string
visibility(string $path)

Get a file's visibility.

void
write(string $location, string $contents, array $config = [])

Write a file.

void
writeStream(string $location, mixed $contents, array $config = [])

Write a file stream.

void
setVisibility(string $path, string $visibility)

Set a file's visibility.

void
delete(string $location)

Delete a file.

void
deleteDirectory(string $location)

Delete a directory.

void
createDirectory(string $location, array $config = [])

Create a directory.

void
move(string $source, string $destination, array $config = [])

Move a file.

void
copy(string $source, string $destination, array $config = [])

Copy a file.

Details

at line 26
__construct(Closure $operation, Closure $stream, Closure|null $range = null)

Create an operator with separately owned stream lifetimes.

Parameters

Closure $operation
Closure $stream
Closure|null $range

at line 36
bool fileExists(string $location)

Determine if a file exists.

Parameters

string $location

Return Value

bool

at line 44
bool directoryExists(string $location)

Determine if a directory exists.

Parameters

string $location

Return Value

bool

at line 52
bool has(string $location)

Determine if a file or directory exists.

Parameters

string $location

Return Value

bool

at line 60
string read(string $location)

Read a file.

Parameters

string $location

Return Value

string

at line 70
mixed readStream(string $location)

Open a stream that retains any required lease until closure.

Parameters

string $location

Return Value

mixed

at line 80
mixed readStreamRange(string $path, int|null $start, int|null $end)

Open a native ranged stream, or return null when ranges are unsupported.

Parameters

string $path
int|null $start
int|null $end

Return Value

mixed

at line 90
DirectoryListing listContents(string $location, bool $deep = self::LIST_SHALLOW)

List contents without holding a lease while the caller processes entries.

Parameters

string $location
bool $deep

Return Value

DirectoryListing

at line 100
int lastModified(string $path)

Get a file's last modification time.

Parameters

string $path

Return Value

int

at line 108
int fileSize(string $path)

Get a file's size.

Parameters

string $path

Return Value

int

at line 116
string mimeType(string $path)

Get a file's MIME type.

Parameters

string $path

Return Value

string

at line 124
string visibility(string $path)

Get a file's visibility.

Parameters

string $path

Return Value

string

at line 132
void write(string $location, string $contents, array $config = [])

Write a file.

Parameters

string $location
string $contents
array $config

Return Value

void

at line 144
void writeStream(string $location, mixed $contents, array $config = [])

Write a file stream.

Parameters

string $location
mixed $contents
array $config

Return Value

void

at line 154
void setVisibility(string $path, string $visibility)

Set a file's visibility.

Parameters

string $path
string $visibility

Return Value

void

at line 164
void delete(string $location)

Delete a file.

Parameters

string $location

Return Value

void

at line 174
void deleteDirectory(string $location)

Delete a directory.

Parameters

string $location

Return Value

void

at line 184
void createDirectory(string $location, array $config = [])

Create a directory.

Parameters

string $location
array $config

Return Value

void

at line 194
void move(string $source, string $destination, array $config = [])

Move a file.

Parameters

string $source
string $destination
array $config

Return Value

void

at line 204
void copy(string $source, string $destination, array $config = [])

Copy a file.

Parameters

string $source
string $destination
array $config

Return Value

void