From 5703e6aa4c2224c2d870d0fc96c8f207edd6e150 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 25 Mar 2016 09:47:47 -0500 Subject: [PATCH] oops: Fix PHP 5.4 compatibility issue --- include/class.file.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/include/class.file.php b/include/class.file.php index c53858e33..bcdb9e0ed 100644 --- a/include/class.file.php +++ b/include/class.file.php @@ -14,6 +14,21 @@ require_once(INCLUDE_DIR.'class.signal.php'); require_once(INCLUDE_DIR.'class.error.php'); + +/** + * Represents a file stored in a storage backend. It is generally attached + * to something; however company logos, login page backdrops, and other + * items are also stored in the database for various purposes. + * + * FileType-Definitions: + * The `ft` field is used to represent the type or purpose of the file + * with respect to the system. These are the defined file types (placed + * here as the definitions are not needed in code). + * + * - 'T' => Attachments + * - 'L' => Logo + * - 'B' => Backdrop + */ class AttachmentFile extends VerySimpleModel { static $meta = array( @@ -837,16 +852,11 @@ class AttachmentFileChunk extends VerySimpleModel { ), ); } + class AttachmentChunkedData extends FileStorageBackend { static $desc = /* @trans */ "In the database"; static $blocksize = CHUNK_SIZE; - const FILE_TYPES = array( - 'T' => 'Attachment', - 'L' => 'Logo', - 'B' => 'Backdrop', - ); - function __construct($file) { $this->file = $file; $this->_chunk = 0; -- GitLab