ScopedCloudFilesystemProxy
class ScopedCloudFilesystemProxy extends ScopedFilesystemProxy implements Cloud
Traits
Properties
| protected PathNormalizer | $normalizer | from ScopedFilesystemProxy |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Copy a file to another disk.
Move a file to another disk.
Transfer a file without holding a source lease during the destination write.
Create a dynamically scoped cloud filesystem.
Assert that the given file or directory exists.
Assert that the number of files in path equals the expected count.
Assert that the given file or directory does not exist.
Assert that the given directory is empty.
Assert that the scoped disk contains no files.
Determine if a scoped path exists using the Flysystem operator.
Read a scoped file using the Flysystem operator.
Get a scoped file size using the Flysystem operator.
Get raw Flysystem visibility for a scoped path.
Write a scoped file using the Flysystem operator.
Create a scoped directory using the Flysystem operator.
Determine if a scoped file or directory exists.
Determine if a scoped file or directory is missing.
Determine if a scoped directory exists.
Determine if a scoped directory is missing.
Get the contents of a scoped file as decoded JSON.
Create a streamed response for a scoped file.
Create a streamed download response for a scoped file.
Create an image instance from a scoped file in storage.
Write the contents of a scoped file.
Store an uploaded file on the scoped disk.
Store an uploaded file with a given name on the scoped disk.
Write a scoped file using a stream.
Set the visibility for a scoped path.
Prepend to a scoped file.
Append to a scoped file.
Copy a scoped file to another scoped path.
Move a scoped file to another scoped path.
Transfer a file using one resolved source disk and prefix.
Get the checksum of a scoped file.
Get the last modification time of a scoped file.
Get a partial stream for a scoped file.
Get a temporary URL for a scoped file.
Get a temporary upload URL for a scoped file.
Determine if the inner disk provides temporary URLs.
Determine if the inner disk provides temporary upload URLs.
Get scoped files in a directory.
Get all scoped files in a directory recursively.
Get scoped directories in a directory.
Get all scoped directories in a directory recursively.
Delete a scoped directory recursively.
Reject mutation of the shared inner disk's temporary URL callback.
Reject mutation of the shared inner disk's temporary upload URL callback.
Reject calls that have not been explicitly mapped through the prefix boundary.
Resolve and validate the prefix for one public operation.
Apply a validated prefix to a normalized user path.
Strip a validated prefix from an inner returned path.
Resolve the inner cloud filesystem for one public operation.
Forward one audited method to the inner disk.
Create the exception for every rejected internal or shared-state mutator.
Get the URL for a scoped file.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
in
TransfersFiles at line 21
bool
copyToDisk(Filesystem|string|UnitEnum $disk, string $from, string|null $to = null)
Copy a file to another disk.
in
TransfersFiles at line 33
bool
moveToDisk(Filesystem|string|UnitEnum $disk, string $from, string|null $to = null)
Move a file to another disk.
in
TransfersFiles at line 41
protected bool
transferFile(Filesystem $source, string $from, Filesystem $destination, string $to)
Transfer a file without holding a source lease during the destination write.
at line 21
__construct(Filesystem|Closure $disk, Closure $prefixResolver, bool $allowRootPassthrough = false)
Create a dynamically scoped cloud filesystem.
in
ScopedFilesystemProxy at line 62
ScopedFilesystemProxy
assertExists(array|string $path, string|null $content = null)
Assert that the given file or directory exists.
in
ScopedFilesystemProxy at line 76
ScopedFilesystemProxy
assertCount(string $path, int $count, bool $recursive = false)
Assert that the number of files in path equals the expected count.
in
ScopedFilesystemProxy at line 87
ScopedFilesystemProxy
assertMissing(array|string $path)
Assert that the given file or directory does not exist.
in
ScopedFilesystemProxy at line 101
ScopedFilesystemProxy
assertDirectoryEmpty(string $path)
Assert that the given directory is empty.
in
ScopedFilesystemProxy at line 112
ScopedFilesystemProxy
assertEmpty()
Assert that the scoped disk contains no files.
in
ScopedFilesystemProxy at line 123
string
path(string $path)
Get the full path to a scoped file.
in
ScopedFilesystemProxy at line 133
bool
has(string $location)
Determine if a scoped path exists using the Flysystem operator.
in
ScopedFilesystemProxy at line 143
string
read(string $location)
Read a scoped file using the Flysystem operator.
in
ScopedFilesystemProxy at line 153
int
fileSize(string $path)
Get a scoped file size using the Flysystem operator.
in
ScopedFilesystemProxy at line 163
string
visibility(string $path)
Get raw Flysystem visibility for a scoped path.
in
ScopedFilesystemProxy at line 173
void
write(string $location, string $contents, array $config = [])
Write a scoped file using the Flysystem operator.
in
ScopedFilesystemProxy at line 182
void
createDirectory(string $location, array $config = [])
Create a scoped directory using the Flysystem operator.
in
ScopedFilesystemProxy at line 191
bool
exists(string $path)
Determine if a scoped file or directory exists.
in
ScopedFilesystemProxy at line 201
bool
missing(string $path)
Determine if a scoped file or directory is missing.
in
ScopedFilesystemProxy at line 211
bool
fileExists(string $path)
Determine if a scoped file exists.
in
ScopedFilesystemProxy at line 221
bool
fileMissing(string $path)
Determine if a scoped file is missing.
in
ScopedFilesystemProxy at line 231
bool
directoryExists(string $path)
Determine if a scoped directory exists.
in
ScopedFilesystemProxy at line 241
bool
directoryMissing(string $path)
Determine if a scoped directory is missing.
in
ScopedFilesystemProxy at line 251
string|null
get(string $path)
Get the contents of a scoped file.
in
ScopedFilesystemProxy at line 261
array|bool|float|int|string|null
json(string $path, int $flags = 0)
Get the contents of a scoped file as decoded JSON.
in
ScopedFilesystemProxy at line 271
StreamedResponse
response(string $path, string|null $name = null, array $headers = [], string $disposition = 'inline')
Create a streamed response for a scoped file.
in
ScopedFilesystemProxy at line 290
Response
serve(Request $request, string $path, string|null $name = null, array $headers = [])
Create a streamed response for serving a scoped file.
in
ScopedFilesystemProxy at line 305
StreamedResponse
download(string $path, string|null $name = null, array $headers = [])
Create a streamed download response for a scoped file.
in
ScopedFilesystemProxy at line 315
Image
image(string $path)
Create an image instance from a scoped file in storage.
in
ScopedFilesystemProxy at line 333
bool|string
put(string $path, mixed $contents, mixed $options = [])
Write the contents of a scoped file.
in
ScopedFilesystemProxy at line 344
false|string
putFile(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file = null, mixed $options = [])
Store an uploaded file on the scoped disk.
in
ScopedFilesystemProxy at line 363
false|string
putFileAs(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file, array|string|null $name = null, mixed $options = [])
Store an uploaded file with a given name on the scoped disk.
in
ScopedFilesystemProxy at line 389
bool
writeStream(string $path, mixed $resource, array $options = [])
Write a scoped file using a stream.
in
ScopedFilesystemProxy at line 399
string
getVisibility(string $path)
Get the visibility for a scoped path.
in
ScopedFilesystemProxy at line 409
bool
setVisibility(string $path, string $visibility)
Set the visibility for a scoped path.
in
ScopedFilesystemProxy at line 419
bool
prepend(string $path, string $data, string $separator = PHP_EOL)
Prepend to a scoped file.
in
ScopedFilesystemProxy at line 429
bool
append(string $path, string $data, string $separator = PHP_EOL)
Append to a scoped file.
in
ScopedFilesystemProxy at line 439
bool
delete(array|string $paths)
Delete scoped files.
in
ScopedFilesystemProxy at line 452
bool
copy(string $from, string $to)
Copy a scoped file to another scoped path.
in
ScopedFilesystemProxy at line 465
bool
move(string $from, string $to)
Move a scoped file to another scoped path.
in
ScopedFilesystemProxy at line 494
protected bool
transferToDisk(Filesystem|string|UnitEnum $disk, string $from, string|null $to, bool $move)
Transfer a file using one resolved source disk and prefix.
in
ScopedFilesystemProxy at line 517
int
size(string $path)
Get the size of a scoped file.
in
ScopedFilesystemProxy at line 527
false|string
checksum(string $path, array $options = [])
Get the checksum of a scoped file.
in
ScopedFilesystemProxy at line 537
false|string
mimeType(string $path)
Get the MIME type of a scoped file.
in
ScopedFilesystemProxy at line 547
int
lastModified(string $path)
Get the last modification time of a scoped file.
in
ScopedFilesystemProxy at line 559
mixed
readStream(string $path)
Get a stream for a scoped file.
in
ScopedFilesystemProxy at line 571
mixed
readStreamRange(string $path, int|null $start, int|null $end)
Get a partial stream for a scoped file.
in
ScopedFilesystemProxy at line 581
string
temporaryUrl(string $path, DateTimeInterface $expiration, array $options = [])
Get a temporary URL for a scoped file.
in
ScopedFilesystemProxy at line 591
array|string
temporaryUploadUrl(string $path, DateTimeInterface $expiration, array $options = [])
Get a temporary upload URL for a scoped file.
in
ScopedFilesystemProxy at line 604
bool
providesTemporaryUrls()
Determine if the inner disk provides temporary URLs.
in
ScopedFilesystemProxy at line 612
bool
providesTemporaryUploadUrls()
Determine if the inner disk provides temporary upload URLs.
in
ScopedFilesystemProxy at line 620
array
getConfig()
Get the inner disk configuration.
in
ScopedFilesystemProxy at line 628
array
files(string|null $directory = null, bool $recursive = false)
Get scoped files in a directory.
in
ScopedFilesystemProxy at line 642
array
allFiles(string|null $directory = null)
Get all scoped files in a directory recursively.
in
ScopedFilesystemProxy at line 653
array
directories(string|null $directory = null, bool $recursive = false)
Get scoped directories in a directory.
in
ScopedFilesystemProxy at line 667
array
allDirectories(string|null $directory = null)
Get all scoped directories in a directory recursively.
in
ScopedFilesystemProxy at line 678
bool
makeDirectory(string $path)
Create a scoped directory.
in
ScopedFilesystemProxy at line 688
bool
deleteDirectory(string $directory)
Delete a scoped directory recursively.
in
ScopedFilesystemProxy at line 698
never
getDriver()
Reject access to the inner Flysystem driver.
in
ScopedFilesystemProxy at line 707
never
getAdapter()
Reject access to the inner Flysystem adapter.
in
ScopedFilesystemProxy at line 716
never
getClient()
Reject access to the inner driver client.
in
ScopedFilesystemProxy at line 725
never
serveUsing(Closure|null $callback)
Reject mutation of the shared inner disk's serve callback.
in
ScopedFilesystemProxy at line 734
never
buildTemporaryUrlsUsing(Closure|null $callback)
Reject mutation of the shared inner disk's temporary URL callback.
in
ScopedFilesystemProxy at line 743
never
buildTemporaryUploadUrlsUsing(Closure|null $callback)
Reject mutation of the shared inner disk's temporary upload URL callback.
in
ScopedFilesystemProxy at line 752
never
__call(string $method, array $parameters)
Reject calls that have not been explicitly mapped through the prefix boundary.
in
ScopedFilesystemProxy at line 762
protected string
prefix()
Resolve and validate the prefix for one public operation.
in
ScopedFilesystemProxy at line 779
protected string
applyPrefix(string $prefix, string $path)
Apply a validated prefix to a normalized user path.
in
ScopedFilesystemProxy at line 789
protected string
stripPrefix(string $prefix, string $path)
Strip a validated prefix from an inner returned path.
at line 44
protected Filesystem
resolveDisk()
Resolve the inner cloud filesystem for one public operation.
The narrowed return type enforces the Cloud contract for dynamically resolved disks.
in
ScopedFilesystemProxy at line 821
protected mixed
call(string $method, array $arguments)
Forward one audited method to the inner disk.
in
ScopedFilesystemProxy at line 847
protected RuntimeException
unsupportedMutationOrInternal(string $method)
Create the exception for every rejected internal or shared-state mutator.
at line 32
string
url(string $path)
Get the URL for a scoped file.