Свойство | Тип | Описание | |
---|---|---|---|
$dimensions | The max height and width image allowed | ||
$fullPath | The full image path (dir + image + mime) | ||
$height | The image height in pixels | ||
$imageMimes | list of known image types | ||
$location | The folder or image storage location | ||
$mime | The image mime type (extension) | ||
$mimeTypes | The mime types allowed for upload | ||
$name | The new image name, to be provided or will be generated. | ||
$serialize | A json format of all information about an image | ||
$size | The min and max image size allowed for upload (in bytes) | ||
$width | The image width in pixels |
Метод | Описание | |
---|---|---|
__construct ( array $_files = [] ) | ||
getError ( ) : string | boolean | Returns error string or false if no errors occurred | |
getFullPath ( ) : string | Returns the full path of the image ex "location/image.mime" | |
getHeight ( ) : integer | Returns the image height in pixels | |
getJson ( ) : string | Returns a JSON format of the image width, height, name, mime . | |
getLocation ( ) : string | Returns the storage / folder name | |
getMime ( ) : string | Returns the image mime type | |
getName ( ) : string | Returns the image name | |
getSize ( ) : integer | Returns the image size in bytes | |
getWidth ( ) : integer | Returns the image width | |
moveUploadedFile ( $tmp_name, $destination ) : boolean | Final upload method to be called, isolated for testing purposes | |
offsetExists ( $offset ) | ||
offsetGet ( mixed $offset ) : boolean | mixed | Gets array value \ArrayAccess | |
offsetSet ( $offset, $value ) | array offset \ArrayAccess unused | |
offsetUnset ( $offset ) | ||
setDimension ( $maxWidth, $maxHeight ) | Sets acceptable max image height and width | |
setLocation ( $dir = "bulletproof", integer $permission = 438 ) | Creates a location for upload storage | |
setMime ( array $fileTypes ) | Define a mime type for uploading | |
setName ( $isNameProvided = null ) | Renames image | |
setSize ( $min, $max ) | Define a min and max image size for uploading | |
upload ( ) | Main upload method. |
Метод | Описание | |
---|---|---|
getImageMime ( $tmp_name ) : boolean | string | Gets the real image mime type | |
uploadErrors ( $e ) | Checks for the common upload errors |
public __construct ( array $_files = [] ) | ||
$_files | array | represents the $_FILES array passed as dependancy |
public getFullPath ( ) : string | ||
Результат | string |
protected getImageMime ( $tmp_name ) : boolean | string | ||
$tmp_name | string The upload tmp directory | |
Результат | boolean | string |
public getLocation ( ) : string | ||
Результат | string |
public moveUploadedFile ( $tmp_name, $destination ) : boolean | ||
$tmp_name | int the temporary location of the image file | |
$destination | int upload destination | |
Результат | boolean |
public setDimension ( $maxWidth, $maxHeight ) | ||
$maxWidth | int max width value | |
$maxHeight | int max height value |
public setLocation ( $dir = "bulletproof", integer $permission = 438 ) | ||
$dir | string the folder name to create | |
$permission | integer | chmod permission |
public setSize ( $min, $max ) | ||
$min | int minimum value in bytes | |
$max | int maximum value in bytes |
protected uploadErrors ( $e ) | ||
$e | int error constant |