ReadThroughFilesystemAdapter
class ReadThroughFilesystemAdapter implements FilesystemAdapter
Methods
Create a new read-through filesystem adapter instance.
Determine if a file exists.
Determine if a directory exists.
Write a file to the primary filesystem.
Write a file stream to the primary filesystem.
Read a file, promoting it from the fallback filesystem when necessary.
Read a file stream, promoting it from the fallback filesystem when necessary.
Open a native range when no fallback promotion is needed.
Delete a file from both filesystems.
Delete a directory from both filesystems.
Create a directory on the primary filesystem.
Set a file's visibility on the filesystem containing it.
Retrieve a file's visibility.
Retrieve a file's MIME type.
Retrieve a file's last modified time.
Retrieve a file's size.
List the contents of the primary filesystem.
Move a file on the primary filesystem and remove its fallback source.
Copy a file on the primary filesystem, reading it from the fallback filesystem when necessary.
Move a file to its destination on the primary filesystem.
Copy a file from the fallback filesystem to the primary filesystem.
Spool the fallback file and release its lease before borrowing the primary.
Get the filesystem that contains the given path.
Handle an exception encountered while promoting a file.
Details
at line 24
__construct(FilesystemOperator $primary, FilesystemOperator $fallback, bool $throwOnPromotionFailure = false, bool $copy = true)
Create a new read-through filesystem adapter instance.
at line 35
bool
fileExists(string $path)
Determine if a file exists.
at line 43
bool
directoryExists(string $path)
Determine if a directory exists.
at line 51
void
write(string $path, string $contents, Config $config)
Write a file to the primary filesystem.
at line 61
void
writeStream(string $path, mixed $contents, Config $config)
Write a file stream to the primary filesystem.
at line 69
string
read(string $path)
Read a file, promoting it from the fallback filesystem when necessary.
at line 99
mixed
readStream(string $path)
Read a file stream, promoting it from the fallback filesystem when necessary.
at line 150
mixed
readStreamRange(string $path, int|null $start, int|null $end)
Open a native range when no fallback promotion is needed.
at line 164
void
delete(string $path)
Delete a file from both filesystems.
at line 176
void
deleteDirectory(string $path)
Delete a directory from both filesystems.
at line 188
void
createDirectory(string $path, Config $config)
Create a directory on the primary filesystem.
at line 196
void
setVisibility(string $path, string $visibility)
Set a file's visibility on the filesystem containing it.
at line 204
FileAttributes
visibility(string $path)
Retrieve a file's visibility.
at line 212
FileAttributes
mimeType(string $path)
Retrieve a file's MIME type.
at line 220
FileAttributes
lastModified(string $path)
Retrieve a file's last modified time.
at line 228
FileAttributes
fileSize(string $path)
Retrieve a file's size.
at line 236
iterable
listContents(string $path, bool $deep)
List the contents of the primary filesystem.
at line 244
void
move(string $source, string $destination, Config $config)
Move a file on the primary filesystem and remove its fallback source.
at line 260
void
copy(string $source, string $destination, Config $config)
Copy a file on the primary filesystem, reading it from the fallback filesystem when necessary.
at line 278
protected void
moveOnPrimary(string $source, string $destination, Config $config)
Move a file to its destination on the primary filesystem.
at line 296
protected void
copyFromFallback(string $source, string $destination, Config $config)
Copy a file from the fallback filesystem to the primary filesystem.
at line 314
protected mixed
spoolFallback(string $path)
Spool the fallback file and release its lease before borrowing the primary.
at line 341
protected FilesystemOperator
readerFor(string $path)
Get the filesystem that contains the given path.
at line 349
protected void
handlePromotionFailure(string $path, FilesystemException $exception)
Handle an exception encountered while promoting a file.