FilesystemAdapterDecorator
trait FilesystemAdapterDecorator
Traits
Decorates the underlying filesystem by wrapping all calls to it with tracing.
Properties
| protected Filesystem | $filesystem | from FilesystemDecorator | |
| protected array | $defaultData | from FilesystemDecorator | |
| protected bool | $recordSpans | from FilesystemDecorator | |
| protected bool | $recordBreadcrumbs | from FilesystemDecorator |
Methods
Execute the method on the underlying filesystem and wrap it with tracing and log a breadcrumb.
Get the full path to the file that exists at the given relative path.
Get a resource to read part of the file.
Write the contents of a file.
Store the uploaded file on the disk.
Store the uploaded file on the disk with a given name.
Write a new file using a stream.
Set the visibility for the given path.
Prepend to a file.
Append to a file.
Copy a file to another disk.
Move a file to another disk.
Trace a transfer while preserving the wrapped disk's identity check.
Get an array of all files in a directory.
Get all of the files from the given directory recursively.
Get all of the directories within a given directory.
Get all of the directories recursively.
Invalidate the wrapped filesystem's pool when supported.
Get the description and data for one or more paths.
Dynamically proxy calls to the wrapped filesystem.
Assert that the given file or directory exists.
Assert that the given file or directory does not exist.
Assert that the given directory is empty.
Determine if a file exists.
Determine if a directory exists.
Get the checksum for a file.
Get the mime-type of a given file.
Determine if temporary URLs can be generated.
Determine if temporary upload URLs can be generated.
Get a temporary URL for the file at the given path.
Get a temporary upload URL for the file at the given path.
Define a custom temporary upload URL builder callback.
Details
in
FilesystemDecorator at line 46
protected mixed
withSentry(string $method, array $args, string|null $description, array $data)
Execute the method on the underlying filesystem and wrap it with tracing and log a breadcrumb.
in
FilesystemDecorator at line 80
string
path(string $path)
Get the full path to the file that exists at the given relative path.
in
FilesystemDecorator at line 88
bool
exists(string $path)
Determine if a file exists.
in
FilesystemDecorator at line 96
string|null
get(string $path)
Get the contents of a file.
in
FilesystemDecorator at line 106
mixed
readStream(string $path)
Get a resource to read the file.
in
FilesystemDecorator at line 116
mixed
readStreamRange(string $path, int|null $start, int|null $end)
Get a resource to read part of the file.
in
FilesystemDecorator at line 126
bool|string
put(string $path, mixed $contents, mixed $options = [])
Write the contents of a file.
in
FilesystemDecorator at line 136
false|string
putFile(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file = null, mixed $options = [])
Store the uploaded file on the disk.
in
FilesystemDecorator at line 149
false|string
putFileAs(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file, array|string|null $name = null, mixed $options = [])
Store the uploaded file on the disk with a given name.
in
FilesystemDecorator at line 165
bool
writeStream(string $path, mixed $resource, array $options = [])
Write a new file using a stream.
in
FilesystemDecorator at line 173
string
getVisibility(string $path)
Get the visibility for the given path.
in
FilesystemDecorator at line 181
bool
setVisibility(string $path, string $visibility)
Set the visibility for the given path.
in
FilesystemDecorator at line 189
bool
prepend(string $path, string $data, string $separator = PHP_EOL)
Prepend to a file.
in
FilesystemDecorator at line 199
bool
append(string $path, string $data, string $separator = PHP_EOL)
Append to a file.
in
FilesystemDecorator at line 209
bool
delete(array|string $paths)
Delete the file at a given path.
in
FilesystemDecorator at line 219
bool
copy(string $from, string $to)
Copy a file to a new location.
in
FilesystemDecorator at line 227
bool
move(string $from, string $to)
Move a file to a new location.
in
FilesystemDecorator at line 235
bool
copyToDisk(Filesystem|string|UnitEnum $disk, string $from, string|null $to = null)
Copy a file to another disk.
in
FilesystemDecorator at line 243
bool
moveToDisk(Filesystem|string|UnitEnum $disk, string $from, string|null $to = null)
Move a file to another disk.
in
FilesystemDecorator at line 251
protected bool
transferToDisk(string $method, Filesystem|string|UnitEnum $disk, string $from, string|null $to)
Trace a transfer while preserving the wrapped disk's identity check.
in
FilesystemDecorator at line 273
int
size(string $path)
Get the file size of a given file.
in
FilesystemDecorator at line 281
int
lastModified(string $path)
Get the file's last modification time.
in
FilesystemDecorator at line 289
array
files(string|null $directory = null, bool $recursive = false)
Get an array of all files in a directory.
in
FilesystemDecorator at line 297
array
allFiles(string|null $directory = null)
Get all of the files from the given directory recursively.
in
FilesystemDecorator at line 305
array
directories(string|null $directory = null, bool $recursive = false)
Get all of the directories within a given directory.
in
FilesystemDecorator at line 313
array
allDirectories(string|null $directory = null)
Get all of the directories recursively.
in
FilesystemDecorator at line 321
bool
makeDirectory(string $path)
Create a directory.
in
FilesystemDecorator at line 329
bool
deleteDirectory(string $directory)
Recursively delete a directory.
in
FilesystemDecorator at line 337
Filesystem
getFilesystem()
Get the wrapped filesystem.
in
FilesystemDecorator at line 345
bool
invalidatePool()
Invalidate the wrapped filesystem's pool when supported.
in
FilesystemDecorator at line 356
protected array
getDescriptionAndDataForPathOrPaths(array|string $pathOrPaths)
Get the description and data for one or more paths.
in
FilesystemDecorator at line 372
mixed
__call(string $name, array $arguments)
Dynamically proxy calls to the wrapped filesystem.
in
CloudFilesystemDecorator at line 14
string
url(string $path)
Get the URL for the file at the given path.
at line 18
FilesystemAdapterDecorator
assertExists(array|string $path, string|null $content = null)
Assert that the given file or directory exists.
at line 32
FilesystemAdapterDecorator
assertMissing(array|string $path)
Assert that the given file or directory does not exist.
at line 44
FilesystemAdapterDecorator
assertDirectoryEmpty(string $path)
Assert that the given directory is empty.
at line 54
bool
fileExists(string $path)
Determine if a file exists.
at line 62
bool
directoryExists(string $path)
Determine if a directory exists.
at line 70
false|string
checksum(string $path, array $options = [])
Get the checksum for a file.
at line 78
false|string
mimeType(string $path)
Get the mime-type of a given file.
at line 86
bool
providesTemporaryUrls()
Determine if temporary URLs can be generated.
at line 94
bool
providesTemporaryUploadUrls()
Determine if temporary upload URLs can be generated.
at line 102
string
temporaryUrl(string $path, DateTimeInterface $expiration, array $options = [])
Get a temporary URL for the file at the given path.
at line 110
array|string
temporaryUploadUrl(string $path, DateTimeInterface $expiration, array $options = [])
Get a temporary upload URL for the file at the given path.
at line 122
void
buildTemporaryUrlsUsing(Closure|null $callback)
Define a custom temporary URL builder callback.
Boot-only. The callback persists on the cached disk adapter for the worker lifetime and runs on every subsequent temporary URL generation for that disk.
at line 134
void
buildTemporaryUploadUrlsUsing(Closure|null $callback)
Define a custom temporary upload URL builder callback.
Boot-only. The callback persists on the cached disk adapter for the worker lifetime and runs on every subsequent temporary upload URL generation for that disk.