Definition at line 35 of file IsCompressed.php.
◆ __construct()
__construct |
( |
|
$mimetype = array() | ) |
|
Sets validator options
- Parameters
-
Definition at line 58 of file IsCompressed.php.
61 $mimetype = $mimetype->toArray();
71 'application/vnd.ms-cab-compressed',
72 'application/x-ace-compressed',
74 'application/x-archive',
77 'application/x-bzip2',
78 'application/x-cab-compressed',
79 'application/x-compress',
80 'application/x-compressed',
82 'application/x-debian-package',
85 'application/x-java-pack200',
87 'application/x-lharc',
93 'application/x-stuffit',
101 if (is_array($mimetype)) {
103 if (array_key_exists(
'magicfile', $temp)) {
104 unset($temp[
'magicfile']);
107 if (array_key_exists(
'headerCheck', $temp)) {
108 unset($temp[
'headerCheck']);
112 $mimetype += $default;
116 if (empty($mimetype)) {
117 $mimetype = $default;
120 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 131 of file IsCompressed.php.
133 $this->_value = $file[
'name'];
146 $this->
_error($errorType);
_error($messageKey, $value=null)
◆ $_messageTemplates
Initial value:= array(
self::FALSE_TYPE => "File '%value%' is not compressed, '%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 IsCompressed.php.
◆ FALSE_TYPE
const FALSE_TYPE = 'fileIsCompressedFalseType' |
◆ NOT_DETECTED
const NOT_DETECTED = 'fileIsCompressedNotDetected' |
◆ NOT_READABLE
const NOT_READABLE = 'fileIsCompressedNotReadable' |
The documentation for this class was generated from the following file: