FlysystemAdapter
in package
implements
Filesystem
Class Filesystem
Interfaces, Classes and Traits
- Filesystem
- Interface Filesystem
Table of Contents
- $baseDirectory : string
- $flysystem : FilesystemOperator
- __construct() : mixed
- FilesystemAdapter constructor.
- create() : void
- Creates a new file with the provided path and content.
- delete() : void
- Deletes an existing file.
- getBaseDirectory() : string
- Returns the base directory.
- has() : bool
- Check whether a file exists.
- list() : DirectoryItems
- List content of a directory.
- read() : string|null
- Returns content of a file by the provided path.
- update() : void
- Creates or updates a file with the provided path and content.
Properties
$baseDirectory
protected
string
$baseDirectory
$flysystem
protected
FilesystemOperator
$flysystem
Methods
__construct()
FilesystemAdapter constructor.
public
__construct(FilesystemOperator $flysystem, string $baseDirectory) : mixed
Parameters
- $flysystem : FilesystemOperator
- $baseDirectory : string
Return values
mixed —create()
Creates a new file with the provided path and content.
public
create(string $path[, string $content = '' ]) : void
Parameters
- $path : string
- $content : string = ''
Tags
Return values
void —delete()
Deletes an existing file.
public
delete(string $path) : void
Parameters
- $path : string
Tags
Return values
void —getBaseDirectory()
Returns the base directory.
public
getBaseDirectory() : string
Tags
Return values
string —has()
Check whether a file exists.
public
has(string $path) : bool
Parameters
- $path : string
Tags
Return values
bool —list()
List content of a directory.
public
list(string $directory[, bool $recursive = false ]) : DirectoryItems
Parameters
- $directory : string
-
Relative path to directory.
- $recursive : bool = false
Tags
Return values
DirectoryItems —read()
Returns content of a file by the provided path.
public
read(string $path) : string|null
Parameters
- $path : string
-
Relative path to file.
Tags
Return values
string|null —Returns null if file doesn't exist.
update()
Creates or updates a file with the provided path and content.
public
update(string $path, string $content) : void
Parameters
- $path : string
- $content : string