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

int
file_size(string $path)

Get file size in bytes

float
free_space()

Get space available in bytes

Details

at line 25
void configure(array $options)

Set adapter parameters

Parameters

array $options

options Storage-specific 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

storage_exception

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

storage_exception

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

storage_exception

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

storage_exception

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

storage_exception

at line 93
int file_size(string $path)

Get file size in bytes

Parameters

string $path

The file

Return Value

int

Size in bytes.

Exceptions

storage_exception

at line 101
float free_space()

Get space available in bytes

Return Value

float

Returns available space

Exceptions

storage_exception