class controller

Generic controller for storage

Properties

protected service $cache
protected driver_interface $db
protected storage $storage
protected Request $symfony_request

Methods

__construct(service $cache, driver_interface $db, storage $storage, Request $symfony_request)

Constructor

Response
handle(string $file)

Handler

bool
is_allowed(string $file)

If the user is allowed to download the file

bool
file_exists(string $file)

Check if file exists

void
prepare(StreamedResponse $response, string $file)

Prepare response

void
file_gc()

Garbage Collection

Details

at line 50
__construct(service $cache, driver_interface $db, storage $storage, Request $symfony_request)

Constructor

Parameters

service $cache
driver_interface $db
storage $storage
Request $symfony_request

at line 68
Response handle(string $file)

Handler

Parameters

string $file

File path

Return Value

Response

a Symfony response object

Exceptions

http_exception

when can't access $file

exception

when there is an error reading the file

at line 99
protected bool is_allowed(string $file)

If the user is allowed to download the file

Parameters

string $file

File path

Return Value

bool

at line 111
protected bool file_exists(string $file)

Check if file exists

Parameters

string $file

File path

Return Value

bool

at line 125
protected void prepare(StreamedResponse $response, string $file)

Prepare response

Parameters

StreamedResponse $response
string $file

File path

Return Value

void

Exceptions

exception

when there is an error reading the file

at line 183
protected void file_gc()

Garbage Collection

Return Value

void