class S3Service implements ServiceInterface (View source)

Methods

configure(array $config)

S3Service Configuration

static S3Service
getInstance()

Get S3Service

array|bool
store(UploadFile $file, string|null $location = null, array $option = [])

Function to upload a file

bool
append(string $filename, string $content)

Add content after the contents of the file

bool
prepend(string $filename, string $content)

Add content before the contents of the file

bool
put(string $file, string $content, array $options = [])

Put other file content in given file

bool
delete(string|array $filename)

Delete file or directory

array
files(string $dirname)

List the files of a folder passed as a parameter

array
directories(string $dirname)

List the folder of a folder passed as a parameter

bool
makeDirectory(string $bucket, int $mode = 0777, array $option = [])

Create a directory

string|null
get(string $filename)

Recover the contents of the file

bool
copy(string $source, string $target)

Copy the contents of a source file to a target file.

bool
move(string $source, string $target)

Renames or moves a source file to a target file.

bool
exists(string $filename)

Check the existence of a file

bool
isFile(string $filename)

isFile alias of is_file.

bool
isDirectory(string $dirname)

isDirectory alias of is_dir.

string
path(string $filename)

Resolves file path.

Details

static FilesystemInterface configure(array $config)

S3Service Configuration

Parameters

array $config

Return Value

FilesystemInterface

static S3Service getInstance()

Get S3Service

Return Value

S3Service

array|bool store(UploadFile $file, string|null $location = null, array $option = [])

Function to upload a file

Parameters

UploadFile $file
string|null $location
array $option

Return Value

array|bool

Exceptions

InvalidArgumentException

bool append(string $filename, string $content)

Add content after the contents of the file

Parameters

string $filename
string $content

Return Value

bool

bool prepend(string $filename, string $content)

Add content before the contents of the file

Parameters

string $filename
string $content

Return Value

bool

Exceptions

bool put(string $file, string $content, array $options = [])

Put other file content in given file

Parameters

string $file
string $content
array $options

Return Value

bool

bool delete(string|array $filename)

Delete file or directory

Parameters

string|array $filename

Return Value

bool

array files(string $dirname)

List the files of a folder passed as a parameter

Parameters

string $dirname

Return Value

array

array directories(string $dirname)

List the folder of a folder passed as a parameter

Parameters

string $dirname

Return Value

array

bool makeDirectory(string $bucket, int $mode = 0777, array $option = [])

Create a directory

Parameters

string $bucket
int $mode
array $option

Return Value

bool

string|null get(string $filename)

Recover the contents of the file

Parameters

string $filename

Return Value

string|null

bool copy(string $source, string $target)

Copy the contents of a source file to a target file.

Parameters

string $source
string $target

Return Value

bool

bool move(string $source, string $target)

Renames or moves a source file to a target file.

Parameters

string $source
string $target

Return Value

bool

bool exists(string $filename)

Check the existence of a file

Parameters

string $filename

Return Value

bool

bool isFile(string $filename)

isFile alias of is_file.

Parameters

string $filename

Return Value

bool

bool isDirectory(string $dirname)

isDirectory alias of is_dir.

Parameters

string $dirname

Return Value

bool

string path(string $filename)

Resolves file path.

Give the absolute path of a path

Parameters

string $filename

Return Value

string