class FilesystemAdapter implements Filesystem, Cloud (View source)

Methods

void
__construct( FilesystemInterface $driver)

Create a new filesystem adapter instance.

bool
exists( string $path)

Determine if a file exists.

string
get( string $path)

Get the contents of a file.

bool
put( string $path, string|resource $contents, string $visibility = null)

Write the contents of a file.

string
getVisibility( string $path)

Get the visibility for the given path.

void
setVisibility( string $path, string $visibility)

Set the visibility for the given path.

int
prepend( string $path, string $data, $separator = PHP_EOL)

Prepend to a file.

int
append( string $path, string $data, $separator = PHP_EOL)

Append to a file.

bool
delete( string|array $paths)

Delete the file at a given path.

bool
copy( string $from, string $to)

Copy a file to a new location.

bool
move( string $from, string $to)

Move a file to a new location.

int
size( string $path)

Get the file size of a given file.

string|false
mimeType( string $path)

Get the mime-type of a given file.

int
lastModified( string $path)

Get the file's last modification time.

string
url( string $path)

Get the URL for the file at the given path.

array
files( string|null $directory = null, bool $recursive = false)

Get an array of all files in a directory.

array
allFiles( string|null $directory = null)

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

array
directories( string|null $directory = null, bool $recursive = false)

Get all of the directories within a given directory.

array
allDirectories( string|null $directory = null)

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

bool
makeDirectory( string $path)

Create a directory.

bool
deleteDirectory( string $directory)

Recursively delete a directory.

FilesystemInterface
getDriver()

Get the Flysystem driver.

mixed
__call( string $method, array $parameters)

Pass dynamic methods call onto Flysystem.

Details

at line line 32
void __construct( FilesystemInterface $driver)

Create a new filesystem adapter instance.

Parameters

FilesystemInterface $driver

Return Value

void

at line line 43
bool exists( string $path)

Determine if a file exists.

Parameters

string $path

Return Value

bool

at line line 56
string get( string $path)

Get the contents of a file.

Parameters

string $path

Return Value

string

Exceptions

FileNotFoundException

at line line 73
bool put( string $path, string|resource $contents, string $visibility = null)

Write the contents of a file.

Parameters

string $path
string|resource $contents
string $visibility

Return Value

bool

at line line 94
string getVisibility( string $path)

Get the visibility for the given path.

Parameters

string $path

Return Value

string

at line line 110
void setVisibility( string $path, string $visibility)

Set the visibility for the given path.

Parameters

string $path
string $visibility

Return Value

void

at line line 122
int prepend( string $path, string $data, $separator = PHP_EOL)

Prepend to a file.

Parameters

string $path
string $data
$separator

Return Value

int

at line line 138
int append( string $path, string $data, $separator = PHP_EOL)

Append to a file.

Parameters

string $path
string $data
$separator

Return Value

int

at line line 153
bool delete( string|array $paths)

Delete the file at a given path.

Parameters

string|array $paths

Return Value

bool

at line line 175
bool copy( string $from, string $to)

Copy a file to a new location.

Parameters

string $from
string $to

Return Value

bool

at line line 187
bool move( string $from, string $to)

Move a file to a new location.

Parameters

string $from
string $to

Return Value

bool

at line line 198
int size( string $path)

Get the file size of a given file.

Parameters

string $path

Return Value

int

at line line 209
string|false mimeType( string $path)

Get the mime-type of a given file.

Parameters

string $path

Return Value

string|false

at line line 220
int lastModified( string $path)

Get the file's last modification time.

Parameters

string $path

Return Value

int

at line line 231
string url( string $path)

Get the URL for the file at the given path.

Parameters

string $path

Return Value

string

at line line 253
array files( string|null $directory = null, bool $recursive = false)

Get an array of all files in a directory.

Parameters

string|null $directory
bool $recursive

Return Value

array

at line line 266
array allFiles( string|null $directory = null)

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

Parameters

string|null $directory

Return Value

array

at line line 278
array directories( string|null $directory = null, bool $recursive = false)

Get all of the directories within a given directory.

Parameters

string|null $directory
bool $recursive

Return Value

array

at line line 291
array allDirectories( string|null $directory = null)

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

Parameters

string|null $directory

Return Value

array

at line line 302
bool makeDirectory( string $path)

Create a directory.

Parameters

string $path

Return Value

bool

at line line 313
bool deleteDirectory( string $directory)

Recursively delete a directory.

Parameters

string $directory

Return Value

bool

at line line 323
FilesystemInterface getDriver()

Get the Flysystem driver.

Return Value

FilesystemInterface

at line line 378
mixed __call( string $method, array $parameters)

Pass dynamic methods call onto Flysystem.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException