ReadThroughFilesystemAdapter
class ReadThroughFilesystemAdapter implements FilesystemAdapter (View source)
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.
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 primary filesystem.
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.
Get the filesystem that contains the given path.
Handle an exception encountered while promoting a file.
Details
__construct(FilesystemOperator $primary, FilesystemOperator $fallback, bool $throwOnPromotionFailure = false, bool $copy = true)
Create a new read-through filesystem adapter instance.
bool
fileExists(string $path)
Determine if a file exists.
bool
directoryExists(string $path)
Determine if a directory exists.
void
write(string $path, string $contents, Config $config)
Write a file to the primary filesystem.
void
writeStream(string $path, $contents, Config $config)
Write a file stream to the primary filesystem.
string
read(string $path)
Read a file, promoting it from the fallback filesystem when necessary.
readStream(string $path)
Read a file stream, promoting it from the fallback filesystem when necessary.
void
delete(string $path)
Delete a file from both filesystems.
void
deleteDirectory(string $path)
Delete a directory from both filesystems.
void
createDirectory(string $path, Config $config)
Create a directory on the primary filesystem.
void
setVisibility(string $path, string $visibility)
Set a file's visibility on the primary filesystem.
FileAttributes
visibility(string $path)
Retrieve a file's visibility.
FileAttributes
mimeType(string $path)
Retrieve a file's MIME type.
FileAttributes
lastModified(string $path)
Retrieve a file's last modified time.
FileAttributes
fileSize(string $path)
Retrieve a file's size.
iterable
listContents(string $path, bool $deep)
List the contents of the primary filesystem.
void
move(string $source, string $destination, Config $config)
Move a file on the primary filesystem and remove its fallback source.
void
copy(string $source, string $destination, Config $config)
Copy a file on the primary filesystem, reading it from the fallback filesystem when necessary.
protected void
moveOnPrimary(string $source, string $destination, Config $config)
Move a file to its destination on the primary filesystem.
protected void
copyFromFallback(string $source, string $destination, Config $config)
Copy a file from the fallback filesystem to the primary filesystem.
protected FilesystemOperator
readerFor(string $path)
Get the filesystem that contains the given path.
protected void
handlePromotionFailure(string $path, FilesystemException $exception)
Handle an exception encountered while promoting a file.