phpBB API Documentation
Class

phpbb\storage\adapter\local

class local implements adapter_interface, stream_interface

Methods

__construct(filesystem $filesystem, FastImageSize $imagesize, guesser $mimetype_guesser, $phpbb_root_path)

Constructor

configure(array $options)

Set adapter parameters

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

delete(string $path)

Removes files or directories

rename(string $path_orig, string $path_dest)

Rename a file or a directory

copy(string $path_orig, string $path_dest)

Copies a file

resource read_stream(string $path)

Reads a file as a stream

write_stream(string $path, resource $resource)

Writes a new file using a stream

array file_size(string $path)

Get file size

array file_mimetype(string $path)

Get file mimetype

array file_image_width(string $path)

Get image width

array file_image_height(string $path)

Get image height

string get_link(string $path)

Get direct link

free_space()

Details

at line 91
public __construct(filesystem $filesystem, FastImageSize $imagesize, guesser $mimetype_guesser, $phpbb_root_path)

Constructor

Parameters

filesystem $filesystem
FastImageSize $imagesize
guesser $mimetype_guesser
$phpbb_root_path

at line 102
public configure(array $options)

Set adapter parameters

Parameters

array $options options Storage-specific options.

at line 117
public put_contents(string $path, string $content)

Dumps content into a file

Parameters

string $path path The file to be written to.
string $content content The data to write into the file.

Exceptions

exception When the file cannot be written

at line 134
public 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 149
public 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 157
public delete(string $path)

Removes files or directories

Parameters

string $path file/directory to remove

Exceptions

exception When removal fails.

at line 174
public 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

Exceptions

exception When file/directory cannot be renamed

at line 193
public copy(string $path_orig, string $path_dest)

Copies a file

Parameters

string $path_orig The original filename
string $path_dest The target filename

Exceptions

exception When the file cannot be copied

at line 305
public resource read_stream(string $path)

Reads a file as a stream

Parameters

string $path File to read

Return Value

resource Returns a file pointer

Exceptions

exception When unable to open file

at line 320
public write_stream(string $path, resource $resource)

Writes a new file using a stream

Parameters

string $path The target file
resource $resource The resource

Exceptions

exception When target file exists When target file cannot be created

at line 349
public array file_size(string $path)

Get file size

Parameters

string $path The file

Return Value

array Properties

Exceptions

exception When cannot get size

at line 368
public array file_mimetype(string $path)

Get file mimetype

Parameters

string $path The file

Return Value

array Properties

at line 401
public array file_image_width(string $path)

Get image width

Parameters

string $path The file

Return Value

array Properties

at line 413
public array file_image_height(string $path)

Get image height

Parameters

string $path The file

Return Value

array Properties

Get direct link

Parameters

string $path The file

Return Value

string Returns link.

at line 429
public free_space()