From 29e83a9b9d99b18017d60fad84be9ce702995479 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Sun, 26 Jun 2016 17:06:55 +1000 Subject: Remove server side and client side and add submodule --- php | 1 + php/classes/UploadException.class.php | 63 ----------------------------------- 2 files changed, 1 insertion(+), 63 deletions(-) create mode 160000 php delete mode 100755 php/classes/UploadException.class.php (limited to 'php/classes/UploadException.class.php') diff --git a/php b/php new file mode 160000 index 0000000..5abbc32 --- /dev/null +++ b/php @@ -0,0 +1 @@ +Subproject commit 5abbc323d7f64df5fcf16255db79de339dc72567 diff --git a/php/classes/UploadException.class.php b/php/classes/UploadException.class.php deleted file mode 100755 index 8c9e4f6..0000000 --- a/php/classes/UploadException.class.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @author Michiel Thalen - * @copyright Copyright © 1997 - 2016 by the PHP Documentation Group - * @license - * UploadException is licensed under a Creative Commons Attribution 3.0 License - * or later. - * - * Based on a work at - * https://secure.php.net/manual/en/features.file-upload.errors.php#89374. - * - * You should have received a copy of the Creative Commons Attribution 3.0 - * License with this program. If not, see - * . - */ - - -class UploadException extends Exception -{ - public function __construct($code) - { - $message = $this->codeToMessage($code); - parent::__construct($message, 500); - } - - private function codeToMessage($code) - { - switch ($code) { - case UPLOAD_ERR_INI_SIZE: - $message = 'The uploaded file exceeds the upload_max_filesize directive in php.ini'; - break; - case UPLOAD_ERR_FORM_SIZE: - $message = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was '. - 'specified in the HTML form'; - break; - case UPLOAD_ERR_PARTIAL: - $message = 'The uploaded file was only partially uploaded'; - break; - case UPLOAD_ERR_NO_FILE: - $message = 'No file was uploaded'; - break; - case UPLOAD_ERR_NO_TMP_DIR: - $message = 'Missing a temporary folder'; - break; - case UPLOAD_ERR_CANT_WRITE: - $message = 'Failed to write file to disk'; - break; - case UPLOAD_ERR_EXTENSION: - $message = 'File upload stopped by extension'; - break; - - default: - $message = 'Unknown upload error'; - break; - } - - return $message; - } -} -- cgit v1.2.3