class upload

Attachment upload class

Properties

protected auth $auth
protected service $cache
protected config $config
protected upload $files_upload
protected language $language
protected dispatcher $phpbb_dispatcher
protected plupload $plupload
protected storage $storage
protected temp $temp
protected user $user

Methods

__construct(auth $auth, service $cache, config $config, upload $files_upload, language $language, dispatcher $phpbb_dispatcher, plupload $plupload, storage $storage, temp $temp, user $user)

Constructor for attachments upload class

array
upload(string $form_name, int $forum_id, bool $local = false, string $local_storage = '', bool $is_message = false, array $local_filedata = array())

Upload Attachment - filedata is generated here Uses upload class

create_thumbnail()

Create thumbnail for file if necessary

init_files_upload(int $forum_id, bool $is_message)

Init files upload class

check_image(bool $is_image)

Check if uploaded file is really an image

bool
check_attach_quota()

Check if attachment quota was reached

bool
check_disk_space()

Check if there is enough free space available on disk

fill_file_data()

Fills file data with file information and current time as filetime

Details

at line 86
__construct(auth $auth, service $cache, config $config, upload $files_upload, language $language, dispatcher $phpbb_dispatcher, plupload $plupload, storage $storage, temp $temp, user $user)

Constructor for attachments upload class

Parameters

auth $auth
service $cache
config $config
upload $files_upload
language $language
dispatcher $phpbb_dispatcher
plupload $plupload
storage $storage
temp $temp
user $user

at line 113
array upload(string $form_name, int $forum_id, bool $local = false, string $local_storage = '', bool $is_message = false, array $local_filedata = array())

Upload Attachment - filedata is generated here Uses upload class

Parameters

string $form_name

The form name of the file upload input

int $forum_id

The id of the forum

bool $local

Whether the file is local or not

string $local_storage

The path to the local file

bool $is_message

Whether it is a PM or not

array $local_filedata

An file data object created for the local file

Return Value

array

File data array

at line 231
protected create_thumbnail()

Create thumbnail for file if necessary

at line 264
protected init_files_upload(int $forum_id, bool $is_message)

Init files upload class

Parameters

int $forum_id

Forum ID

bool $is_message

Whether attachment is inside PM or not

at line 284
protected check_image(bool $is_image)

Check if uploaded file is really an image

Parameters

bool $is_image

Whether file is image

at line 307
protected bool check_attach_quota()

Check if attachment quota was reached

Return Value

bool

False if attachment quota was reached, true if not

at line 328
protected bool check_disk_space()

Check if there is enough free space available on disk

Return Value

bool

True if disk space is available or not limited, false if not

at line 361
protected fill_file_data()

Fills file data with file information and current time as filetime