Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/files/exception/PhabricatorFileUploadException.php
12242 views
1
<?php
2
3
final class PhabricatorFileUploadException extends Exception {
4
5
public function __construct($code) {
6
$map = array(
7
UPLOAD_ERR_INI_SIZE => pht(
8
"Uploaded file is too large: current limit is %s. To adjust ".
9
"this limit change '%s' in php.ini.",
10
ini_get('upload_max_filesize'),
11
'upload_max_filesize'),
12
UPLOAD_ERR_FORM_SIZE => pht(
13
'File is too large.'),
14
UPLOAD_ERR_PARTIAL => pht(
15
'File was only partially transferred, upload did not complete.'),
16
UPLOAD_ERR_NO_FILE => pht(
17
'No file was uploaded.'),
18
UPLOAD_ERR_NO_TMP_DIR => pht(
19
'Unable to write file: temporary directory does not exist.'),
20
UPLOAD_ERR_CANT_WRITE => pht(
21
'Unable to write file: failed to write to temporary directory.'),
22
UPLOAD_ERR_EXTENSION => pht(
23
'Unable to upload: a PHP extension stopped the upload.'),
24
);
25
26
$message = idx(
27
$map,
28
$code,
29
pht('Upload failed: unknown error (%s).', $code));
30
parent::__construct($message, $code);
31
}
32
}
33
34