interface adapter_interface

Methods

void
configure(array $options)

Set adapter parameters

void
put_contents(string $path, string $content)

Dumps content into a file

string
get_contents(string $path)

Read the contents of a file

bool
exists(string $path)

Checks the existence of files or directories

void
delete(string $path)

Removes files or directories

void
rename(string $path_orig, string $path_dest)

Rename a file or a directory

void
copy(string $path_orig, string $path_dest)

Copies a file

string
get_link(string $path)

Get direct link

float
free_space()

Get space available in bytes

Details

at line 25
void configure(array $options)

Set adapter parameters

Parameters

array $options

Return Value

void

at line 34
void put_contents(string $path, string $content)

Dumps content into a file

Parameters

string $path
string $content

Return Value

void

Exceptions

exception

When the file cannot be written

at line 44
string get_contents(string $path)

Read the contents of a file

Parameters

string $path

The file to read

Return Value

string

Returns file contents

Exceptions

exception

When cannot read file contents

at line 53
bool exists(string $path)

Checks the existence of files or directories

Parameters

string $path

file/directory to check

Return Value

bool

Returns true if the file/directory exist, false otherwise.

at line 62
void delete(string $path)

Removes files or directories

Parameters

string $path

file/directory to remove

Return Value

void

Exceptions

exception

When removal fails.

at line 72
void rename(string $path_orig, string $path_dest)

Rename a file or a directory

Parameters

string $path_orig

The original file/direcotry

string $path_dest

The target file/directory

Return Value

void

Exceptions

exception

When file/directory cannot be renamed

at line 82
void copy(string $path_orig, string $path_dest)

Copies a file

Parameters

string $path_orig

The original filename

string $path_dest

The target filename

Return Value

void

Exceptions

exception

When the file cannot be copied

Get direct link

Parameters

string $path

The file

Return Value

string

Returns link.

at line 99
float free_space()

Get space available in bytes

Return Value

float

Returns available space

Exceptions

exception

When unable to retrieve available storage space