local
class local implements adapter_interface, stream_interface
Experimental
Properties
protected filesystem | $filesystem | Filesystem component |
|
protected FastImageSize | $imagesize | FastImageSize |
|
protected guesser | $mimetype_guesser | Mimetype Guesser component |
|
protected string | $phpbb_root_path | ||
protected string | $root_path | Absolute path to the storage folder Always finish with DIRECTORY_SEPARATOR Example:
|
|
protected string | $path | Relative path from $phpbb_root_path to the storage folder Always finish with slash (/) character Example:
|
|
protected | $subfolders | ||
protected | $dir_depth |
Methods
Constructor
Set adapter parameters
Dumps content into a file
Read the contents of a file
Checks the existence of files or directories
Removes files or directories
Rename a file or a directory
Copies a file
Creates a directory recursively.
Ensures that the directory of a file exists.
Removes the directory tree ascending until it finds a non empty directory.
Get the path to the file, appending subdirectories for directory depth if $dir_depth > 0.
To be used in other PR
Reads a file as a stream
Writes a new file using a stream
Get file size
Get file mimetype
Get image dimensions
Get image width
Get image height
Get direct link
Get space available in bytes
Details
at line 107
__construct(filesystem $filesystem, FastImageSize $imagesize, guesser $mimetype_guesser, string $phpbb_root_path)
Constructor
at line 118
void
configure(array $options)
Set adapter parameters
at line 134
void
put_contents(string $path, string $content)
Dumps content into a file
at line 151
string
get_contents(string $path)
Read the contents of a file
at line 166
bool
exists(string $path)
Checks the existence of files or directories
at line 174
void
delete(string $path)
Removes files or directories
at line 191
void
rename(string $path_orig, string $path_dest)
Rename a file or a directory
at line 210
void
copy(string $path_orig, string $path_dest)
Copies a file
at line 231
protected void
create_dir(string $path)
Creates a directory recursively.
at line 250
protected void
ensure_directory_exists(string $path)
Ensures that the directory of a file exists.
at line 266
protected void
remove_empty_dirs(string $path)
Removes the directory tree ascending until it finds a non empty directory.
at line 291
protected string
get_path(string $path)
Get the path to the file, appending subdirectories for directory depth if $dir_depth > 0.
at line 318
protected string
get_filename(string $path)
To be used in other PR
at line 326
resource
read_stream(string $path)
Reads a file as a stream
at line 341
void
write_stream(string $path, resource $resource)
Writes a new file using a stream
at line 372
array
file_size(string $path)
Get file size
at line 391
array
file_mimetype(string $path)
Get file mimetype
at line 403
protected array
image_dimensions(string $path)
Get image dimensions
at line 424
array
file_image_width(string $path)
Get image width
at line 436
array
file_image_height(string $path)
Get image height
at line 444
string
get_link(string $path)
Get direct link
at line 452
float
free_space()
Get space available in bytes