@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 32 lines 1.1 kB view raw
1<?php 2 3final 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}