summaryrefslogtreecommitdiff
path: root/build/classes/UploadException.class.php
diff options
context:
space:
mode:
authorAustin Gillmann <alucard@cuntflaps.me>2017-01-04 02:21:43 +0100
committerAustin Gillmann <alucard@cuntflaps.me>2017-01-04 02:21:43 +0100
commite594331a15c1ef486e71ada9edcbb3c21fb704ad (patch)
tree41ba1d9d82c75d426154f7365a435f502bde52af /build/classes/UploadException.class.php
parent0297f5d586367704027c64bb740615773dd703be (diff)
doh.
Diffstat (limited to 'build/classes/UploadException.class.php')
-rw-r--r--build/classes/UploadException.class.php63
1 files changed, 0 insertions, 63 deletions
diff --git a/build/classes/UploadException.class.php b/build/classes/UploadException.class.php
deleted file mode 100644
index 8c9e4f6..0000000
--- a/build/classes/UploadException.class.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/**
- * Returns a human readable error description for file upload errors.
- *
- * @author Dan Brown <danbrown@php.net>
- * @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
- * <https://creativecommons.org/licenses/by/3.0/>.
- */
-
-
-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;
- }
-}