platform/api/symfony/Component/HttpFoundation/File/UploadedFile.yaml

223 lines
7.3 KiB
YAML
Raw Normal View History

2024-09-02 17:44:11 +00:00
name: UploadedFile
class_comment: '# * A file uploaded through a form.
# *
# * @author Bernhard Schussek <bschussek@gmail.com>
# * @author Florian Eckerstorfer <florian@eckerstorfer.org>
# * @author Fabien Potencier <fabien@symfony.com>'
dependencies:
- name: CannotWriteFileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException
- name: ExtensionFileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException
- name: FileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\FileException
- name: FileNotFoundException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
- name: FormSizeFileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\FormSizeFileException
- name: IniSizeFileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\IniSizeFileException
- name: NoFileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\NoFileException
- name: NoTmpDirFileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\NoTmpDirFileException
- name: PartialFileException
type: class
source: Symfony\Component\HttpFoundation\File\Exception\PartialFileException
- name: MimeTypes
type: class
source: Symfony\Component\Mime\MimeTypes
properties: []
methods:
- name: __construct
visibility: public
parameters:
- name: path
- name: originalName
- name: mimeType
default: 'null'
- name: error
default: 'null'
- name: test
default: 'false'
comment: "# * A file uploaded through a form.\n# *\n# * @author Bernhard Schussek\
\ <bschussek@gmail.com>\n# * @author Florian Eckerstorfer <florian@eckerstorfer.org>\n\
# * @author Fabien Potencier <fabien@symfony.com>\n# */\n# class UploadedFile\
\ extends File\n# {\n# private string $originalName;\n# private string $mimeType;\n\
# private int $error;\n# private string $originalPath;\n# \n# /**\n# * Accepts\
\ the information of the uploaded file as provided by the PHP global $_FILES.\n\
# *\n# * The file object is only created when the uploaded file is valid (i.e.\
\ when the\n# * isValid() method returns true). Otherwise the only methods that\
\ could be called\n# * on an UploadedFile instance are:\n# *\n# * * getClientOriginalName,\n\
# * * getClientMimeType,\n# * * isValid,\n# * * getError.\n# *\n# * Calling\
\ any other method on an non-valid instance will cause an unpredictable result.\n\
# *\n# * @param string $path The full temporary path to the file\n\
# * @param string $originalName The original file name of the uploaded file\n\
# * @param string|null $mimeType The type of the file as provided by PHP;\
\ null defaults to application/octet-stream\n# * @param int|null $error \
\ The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants);\
\ null defaults to UPLOAD_ERR_OK\n# * @param bool $test Whether\
\ the test mode is active\n# * Local files are\
\ used in test mode hence the code should not enforce HTTP uploads\n# *\n# * @throws\
\ FileException If file_uploads is disabled\n# * @throws FileNotFoundException\
\ If the file does not exist"
- name: getClientOriginalName
visibility: public
parameters: []
comment: '# * Returns the original file name.
# *
# * It is extracted from the request from which the file has been uploaded.
# * This should not be considered as a safe value to use for a file name on your
servers.'
- name: getClientOriginalExtension
visibility: public
parameters: []
comment: '# * Returns the original file extension.
# *
# * It is extracted from the original file name that was uploaded.
# * This should not be considered as a safe value to use for a file name on your
servers.'
- name: getClientOriginalPath
visibility: public
parameters: []
comment: '# * Returns the original file full path.
# *
# * It is extracted from the request from which the file has been uploaded.
# * This should not be considered as a safe value to use for a file name/path
on your servers.
# *
# * If this file was uploaded with the "webkitdirectory" upload directive, this
will contain
# * the path of the file relative to the uploaded root directory. Otherwise this
will be identical
# * to getClientOriginalName().'
- name: getClientMimeType
visibility: public
parameters: []
comment: '# * Returns the file mime type.
# *
# * The client mime type is extracted from the request from which the file
# * was uploaded, so it should not be considered as a safe value.
# *
# * For a trusted mime type, use getMimeType() instead (which guesses the mime
# * type based on the file content).
# *
# * @see getMimeType()'
- name: guessClientExtension
visibility: public
parameters: []
comment: '# * Returns the extension based on the client mime type.
# *
# * If the mime type is unknown, returns null.
# *
# * This method uses the mime type as guessed by getClientMimeType()
# * to guess the file extension. As such, the extension returned
# * by this method cannot be trusted.
# *
# * For a trusted extension, use guessExtension() instead (which guesses
# * the extension based on the guessed mime type for the file).
# *
# * @see guessExtension()
# * @see getClientMimeType()'
- name: getError
visibility: public
parameters: []
comment: '# * Returns the upload error.
# *
# * If the upload was successful, the constant UPLOAD_ERR_OK is returned.
# * Otherwise one of the other UPLOAD_ERR_XXX constants is returned.'
- name: isValid
visibility: public
parameters: []
comment: '# * Returns whether the file has been uploaded with HTTP and no error
occurred.'
- name: move
visibility: public
parameters:
- name: directory
- name: name
default: 'null'
comment: '# * Moves the file to a new location.
# *
# * @throws FileException if, for any reason, the file could not have been moved'
- name: getMaxFilesize
visibility: public
parameters: []
comment: '# * Returns the maximum size of an uploaded file as configured in php.ini.
# *
# * @return int|float The maximum size of an uploaded file in bytes (returns float
if size > PHP_INT_MAX)'
- name: parseFilesize
visibility: private
parameters:
- name: size
comment: null
- name: getErrorMessage
visibility: public
parameters: []
comment: '# * Returns an informative upload error message.'
traits:
- Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException
- Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException
- Symfony\Component\HttpFoundation\File\Exception\FileException
- Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
- Symfony\Component\HttpFoundation\File\Exception\FormSizeFileException
- Symfony\Component\HttpFoundation\File\Exception\IniSizeFileException
- Symfony\Component\HttpFoundation\File\Exception\NoFileException
- Symfony\Component\HttpFoundation\File\Exception\NoTmpDirFileException
- Symfony\Component\HttpFoundation\File\Exception\PartialFileException
- Symfony\Component\Mime\MimeTypes
interfaces: []