storage
class storage
Experimental
Properties
protected adapter_interface | $adapter | ||
protected driver_interface | $db | ||
protected driver_interface | $cache | Cache driver |
|
protected adapter_factory | $factory | ||
protected string | $storage_name | ||
protected string | $storage_table |
Methods
Constructor
Returns storage name
Returns an adapter instance
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
Reads a file as a stream
Writes a new file using a stream
Track file in database
Untrack file
Check if a file is tracked
Rename tracked file
Get file size in bytes
Get total storage size
Get number of storage files
Get space available in bytes
Details
at line 66
__construct(driver_interface $db, driver_interface $cache, adapter_factory $factory, string $storage_name, string $storage_table)
Constructor
at line 80
string
get_name()
Returns storage name
at line 90
protected mixed
get_adapter()
Returns an adapter instance
at line 109
void
put_contents(string $path, string $content)
Dumps content into a file
at line 131
string
get_contents(string $path)
Read the contents of a file
at line 149
bool
exists(string $path, bool $full_check = false)
Checks the existence of files or directories
at line 162
void
delete(string $path)
Removes files or directories
at line 183
void
rename(string $path_orig, string $path_dest)
Rename a file or a directory
at line 209
void
copy(string $path_orig, string $path_dest)
Copies a file
at line 235
resource
read_stream(string $path)
Reads a file as a stream
at line 269
void
write_stream(string $path, resource $resource)
Writes a new file using a stream
at line 301
void
track_file(string $path, bool $update = false)
Track file in database
at line 344
untrack_file(string $path)
Untrack file
at line 366
bool
is_tracked(string $path)
Check if a file is tracked
at line 388
protected void
track_rename(string $path_orig, string $path_dest)
Rename tracked file
at line 406
int
file_size(string $path)
Get file size in bytes
at line 427
int
get_size()
Get total storage size
at line 452
int
get_num_files()
Get number of storage files
at line 479
float
free_space()
Get space available in bytes