Media helper class
- Depuis
- 3.2
◆ canUpload()
canUpload |
( |
|
$file, |
|
|
|
$component = 'com_media' , |
|
|
|
$allowedExecutables = array() |
|
) |
| |
Checks if the file can be uploaded
- Paramètres
-
array | $file | File information |
string | $component | The option name for the component storing the parameters |
string | $allowedExecutables | Array of executable file types that shall be whitelisted |
- Renvoie
- boolean
- Depuis
- 3.2
Références $app, $check, $component, $file, $images, $maxSize, $mime, $params, elseif, ComponentHelper\getParams(), jimport(), et null.
◆ checkMimeType()
checkMimeType |
( |
|
$mime, |
|
|
|
$component = 'com_media' |
|
) |
| |
|
private |
Checks the Mime type
- Paramètres
-
string | $mime | The mime to be checked |
string | $component | The optional name for the component storing the parameters |
- Renvoie
- boolean true if mime type checking is disabled or it passes the checks else false
- Depuis
- 3.7
Références $component, $mime, $params, et ComponentHelper\getParams().
◆ countFiles()
Counts the files and directories in a directory that are not php or html files.
- Paramètres
-
- Renvoie
- array The number of media files and directories in the given directory
- Depuis
- 3.2
Références DIRECTORY_SEPARATOR.
◆ getMimeType()
getMimeType |
( |
|
$file, |
|
|
|
$isImage = false |
|
) |
| |
|
private |
Get the Mime type
- Paramètres
-
string | $file | The link to the file to be checked |
boolean | $isImage | True if the passed file is an image else false |
- Renvoie
- mixed the mime type detected false on error
- Depuis
- 3.7.2
Références $file, $mime, et elseif.
◆ getTypeIcon()
static getTypeIcon |
( |
|
$fileName | ) |
|
|
static |
Gets the file extension for purposed of using an icon
- Paramètres
-
string | $fileName | The filename |
- Renvoie
- string File extension to determine icon
- Depuis
- 3.2
◆ imageResize()
static imageResize |
( |
|
$width, |
|
|
|
$height, |
|
|
|
$target |
|
) |
| |
|
static |
Calculate the size of a resized image
- Paramètres
-
integer | $width | Image width |
integer | $height | Image height |
integer | $target | Target size |
- Renvoie
- array The new width and height
- Depuis
- 3.2
Références $height, $target, et $width.
◆ isImage()
Checks if the file is an image
- Paramètres
-
string | $fileName | The filename |
- Renvoie
- boolean
- Depuis
- 3.2
◆ toBytes()
Small helper function that properly converts any configuration options to their byte representation.
- Paramètres
-
string | integer | $val | The value to be converted to bytes. |
- Renvoie
- integer The calculated bytes value from the input.
- Depuis
- 3.3
La documentation de cette classe a été générée à partir du fichier suivant :