Definition at line 35 of file IsImage.php.
◆ __construct()
__construct |
( |
|
$mimetype = array() | ) |
|
Sets validator options
- Parameters
-
Definition at line 58 of file IsImage.php.
61 $mimetype = $mimetype->toArray();
70 'application/fractals',
71 'application/postscript',
72 'application/vnd.hp-hpgl',
73 'application/vnd.oasis.opendocument.graphics',
75 'application/x-cmu-raster',
77 'application/x-inventor',
79 'application/x-portable-anymap',
80 'application/x-world-x-3dmf',
96 'image/vnd.adobe.photoshop',
100 'image/x-cmu-raster',
112 'image/x-portable-anymap',
113 'image/x-portable-bitmap',
114 'image/x-portable-greymap',
115 'image/x-portable-pixmap',
120 'image/x-windows-bmp',
124 if (is_array($mimetype)) {
126 if (array_key_exists(
'magicfile', $temp)) {
127 unset($temp[
'magicfile']);
130 if (array_key_exists(
'headerCheck', $temp)) {
131 unset($temp[
'headerCheck']);
135 $mimetype += $default;
139 if (empty($mimetype)) {
140 $mimetype = $default;
143 parent::__construct($mimetype);
◆ _throw()
_throw |
( |
|
$file, |
|
|
|
$errorType |
|
) |
| |
|
protected |
Throws an error of the given type Duplicates parent method due to OOP Problem with late static binding in PHP 5.2
- Parameters
-
string | $file | |
string | $errorType | |
- Returns
- false
Definition at line 154 of file IsImage.php.
156 $this->_value = $file[
'name'];
169 $this->
_error($errorType);
_error($messageKey, $value=null)
◆ $_messageTemplates
Initial value:= array(
self::FALSE_TYPE => "File '%value%' is no image, '%type%' detected",
self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
self::NOT_READABLE => "File '%value%' is not readable or does not exist",
)
Definition at line 47 of file IsImage.php.
◆ FALSE_TYPE
const FALSE_TYPE = 'fileIsImageFalseType' |
@const string Error constants
Definition at line 40 of file IsImage.php.
◆ NOT_DETECTED
const NOT_DETECTED = 'fileIsImageNotDetected' |
◆ NOT_READABLE
const NOT_READABLE = 'fileIsImageNotReadable' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Validate/File/IsImage.php