Documentation

FilesystemAdapter
in package
implements Filesystem, Cloud

Tags
mixin

\League\Flysystem\FilesystemInterface

Interfaces, Classes and Traits

Filesystem
Cloud

Table of Contents

$driver  : FilesystemInterface
The Flysystem filesystem implementation.
__call()  : mixed
Pass dynamic methods call onto Flysystem.
__construct()  : void
Create a new filesystem adapter instance.
allDirectories()  : array<string|int, mixed>
Get all (recursive) of the directories within a given directory.
allFiles()  : array<string|int, mixed>
Get all of the files from the given directory (recursive).
append()  : int
Append to a file.
assertExists()  : void
Assert that the given file exists.
assertMissing()  : void
Assert that the given file does not exist.
copy()  : bool
Copy a file to a new location.
delete()  : bool
Delete the file at a given path.
deleteDirectory()  : bool
Recursively delete a directory.
directories()  : array<string|int, mixed>
Get all of the directories within a given directory.
download()  : StreamedResponse
Create a streamed download response for a given file.
exists()  : bool
Determine if a file exists.
files()  : array<string|int, mixed>
Get an array of all files in a directory.
flushCache()  : void
Flush the Flysystem cache.
get()  : string
Get the contents of a file.
getAwsTemporaryUrl()  : string
Get a temporary URL for the file at the given path.
getDriver()  : FilesystemInterface
Get the Flysystem driver.
getRackspaceTemporaryUrl()  : string
Get a temporary URL for the file at the given path.
getVisibility()  : string
Get the visibility for the given path.
lastModified()  : int
Get the file's last modification time.
makeDirectory()  : bool
Create a directory.
mimeType()  : string|false
Get the mime-type of a given file.
move()  : bool
Move a file to a new location.
path()  : string
Get the full path for the file at the given "short" path.
prepend()  : int
Prepend to a file.
put()  : bool
Write the contents of a file.
putFile()  : string|false
Store the uploaded file on the disk.
putFileAs()  : string|false
Store the uploaded file on the disk with a given name.
response()  : StreamedResponse
Create a streamed response for a given file.
setVisibility()  : void
Set the visibility for the given path.
size()  : int
Get the file size of a given file.
temporaryUrl()  : string
Get a temporary URL for the file at the given path.
url()  : string
Get the URL for the file at the given path.
concatPathToUrl()  : string
Concatenate a path to a URL.
filterContentsByType()  : array<string|int, mixed>
Filter directory contents by type.
getAwsUrl()  : string
Get the URL for the file at the given path.
getLocalUrl()  : string
Get the URL for the file at the given path.
getRackspaceUrl()  : string
Get the URL for the file at the given path.
parseVisibility()  : string|null
Parse the given visibility value.

Properties

Methods

__call()

Pass dynamic methods call onto Flysystem.

public __call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
$method : string
$parameters : array<string|int, mixed>
Tags
throws
BadMethodCallException
Return values
mixed

allDirectories()

Get all (recursive) of the directories within a given directory.

public allDirectories([string|null $directory = null ]) : array<string|int, mixed>
Parameters
$directory : string|null = null
Return values
array<string|int, mixed>

allFiles()

Get all of the files from the given directory (recursive).

public allFiles([string|null $directory = null ]) : array<string|int, mixed>
Parameters
$directory : string|null = null
Return values
array<string|int, mixed>

append()

Append to a file.

public append(string $path, string $data[, string $separator = PHP_EOL ]) : int
Parameters
$path : string
$data : string
$separator : string = PHP_EOL
Return values
int

assertExists()

Assert that the given file exists.

public assertExists(string $path) : void
Parameters
$path : string
Return values
void

assertMissing()

Assert that the given file does not exist.

public assertMissing(string $path) : void
Parameters
$path : string
Return values
void

copy()

Copy a file to a new location.

public copy(string $from, string $to) : bool
Parameters
$from : string
$to : string
Return values
bool

delete()

Delete the file at a given path.

public delete(string|array<string|int, mixed> $paths) : bool
Parameters
$paths : string|array<string|int, mixed>
Return values
bool

deleteDirectory()

Recursively delete a directory.

public deleteDirectory(string $directory) : bool
Parameters
$directory : string
Return values
bool

directories()

Get all of the directories within a given directory.

public directories([string|null $directory = null ][, bool $recursive = false ]) : array<string|int, mixed>
Parameters
$directory : string|null = null
$recursive : bool = false
Return values
array<string|int, mixed>

download()

Create a streamed download response for a given file.

public download(string $path[, string|null $name = null ][, array<string|int, mixed>|null $headers = [] ]) : StreamedResponse
Parameters
$path : string
$name : string|null = null
$headers : array<string|int, mixed>|null = []
Return values
StreamedResponse

exists()

Determine if a file exists.

public exists(string $path) : bool
Parameters
$path : string
Return values
bool

files()

Get an array of all files in a directory.

public files([string|null $directory = null ][, bool $recursive = false ]) : array<string|int, mixed>
Parameters
$directory : string|null = null
$recursive : bool = false
Return values
array<string|int, mixed>

flushCache()

Flush the Flysystem cache.

public flushCache() : void
Return values
void

getAwsTemporaryUrl()

Get a temporary URL for the file at the given path.

public getAwsTemporaryUrl(AwsS3Adapter $adapter, string $path, DateTimeInterface $expiration, array<string|int, mixed> $options) : string
Parameters
$adapter : AwsS3Adapter
$path : string
$expiration : DateTimeInterface
$options : array<string|int, mixed>
Return values
string

getRackspaceTemporaryUrl()

Get a temporary URL for the file at the given path.

public getRackspaceTemporaryUrl(RackspaceAdapter $adapter, string $path, DateTimeInterface $expiration, array<string|int, mixed> $options) : string
Parameters
$adapter : RackspaceAdapter
$path : string
$expiration : DateTimeInterface
$options : array<string|int, mixed>
Return values
string

getVisibility()

Get the visibility for the given path.

public getVisibility(string $path) : string
Parameters
$path : string
Return values
string

lastModified()

Get the file's last modification time.

public lastModified(string $path) : int
Parameters
$path : string
Return values
int

makeDirectory()

Create a directory.

public makeDirectory(string $path) : bool
Parameters
$path : string
Return values
bool

mimeType()

Get the mime-type of a given file.

public mimeType(string $path) : string|false
Parameters
$path : string
Return values
string|false

move()

Move a file to a new location.

public move(string $from, string $to) : bool
Parameters
$from : string
$to : string
Return values
bool

path()

Get the full path for the file at the given "short" path.

public path(string $path) : string
Parameters
$path : string
Return values
string

prepend()

Prepend to a file.

public prepend(string $path, string $data[, string $separator = PHP_EOL ]) : int
Parameters
$path : string
$data : string
$separator : string = PHP_EOL
Return values
int

put()

Write the contents of a file.

public put(string $path, string|resource $contents[, mixed $options = [] ]) : bool
Parameters
$path : string
$contents : string|resource
$options : mixed = []
Return values
bool

putFile()

Store the uploaded file on the disk.

public putFile(string $path, File|UploadedFile $file[, array<string|int, mixed> $options = [] ]) : string|false
Parameters
$path : string
$file : File|UploadedFile
$options : array<string|int, mixed> = []
Return values
string|false

putFileAs()

Store the uploaded file on the disk with a given name.

public putFileAs(string $path, File|UploadedFile $file, string $name[, array<string|int, mixed> $options = [] ]) : string|false
Parameters
$path : string
$file : File|UploadedFile
$name : string
$options : array<string|int, mixed> = []
Return values
string|false

response()

Create a streamed response for a given file.

public response(string $path[, string|null $name = null ][, array<string|int, mixed>|null $headers = [] ][, string|null $disposition = 'inline' ]) : StreamedResponse
Parameters
$path : string
$name : string|null = null
$headers : array<string|int, mixed>|null = []
$disposition : string|null = 'inline'
Return values
StreamedResponse

setVisibility()

Set the visibility for the given path.

public setVisibility(string $path, string $visibility) : void
Parameters
$path : string
$visibility : string
Return values
void

size()

Get the file size of a given file.

public size(string $path) : int
Parameters
$path : string
Return values
int

temporaryUrl()

Get a temporary URL for the file at the given path.

public temporaryUrl(string $path, DateTimeInterface $expiration[, array<string|int, mixed> $options = [] ]) : string
Parameters
$path : string
$expiration : DateTimeInterface
$options : array<string|int, mixed> = []
Return values
string

url()

Get the URL for the file at the given path.

public url(string $path) : string
Parameters
$path : string
Return values
string

concatPathToUrl()

Concatenate a path to a URL.

protected concatPathToUrl(string $url, string $path) : string
Parameters
$url : string
$path : string
Return values
string

filterContentsByType()

Filter directory contents by type.

protected filterContentsByType(array<string|int, mixed> $contents, string $type) : array<string|int, mixed>
Parameters
$contents : array<string|int, mixed>
$type : string
Return values
array<string|int, mixed>

getAwsUrl()

Get the URL for the file at the given path.

protected getAwsUrl(AwsS3Adapter $adapter, string $path) : string
Parameters
$adapter : AwsS3Adapter
$path : string
Return values
string

getLocalUrl()

Get the URL for the file at the given path.

protected getLocalUrl(string $path) : string
Parameters
$path : string
Return values
string

parseVisibility()

Parse the given visibility value.

protected parseVisibility(string|null $visibility) : string|null
Parameters
$visibility : string|null
Tags
throws
InvalidArgumentException
Return values
string|null

Search results