PHP 클래스 Uploadcare\File

파일 보기 프로젝트 열기: uploadcare/uploadcare-php 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $uuid_or_url, Api $api, boolean | array | object $data = false ) Constructs an object for CDN file with specified ID
__get ( $name ) : array | null
__toString ( ) : string
copy ( string $target = null ) : File | string Copy the file.
copyTo ( string $target ) : string Copy the file to custom storage.
crop ( integer $width, integer $height, boolean $center = false, string | boolean $fill_color = false ) : File Get object with cropped parameters.
delete ( ) : array Delete file
effect ( string $effect ) : File Apply effect
getFileId ( ) : string Get UUID
getImgTag ( string $postfix = null, array $attribs = [] ) : string Get image tag
getUrl ( string $postfix = null ) : string Get url of original image
getUuid ( ) Get UUID
op ( string $operation ) : File Add any custom operation.
preview ( integer $width, integer $height ) : File Get object with preview parameters.
resize ( integer | boolean $width = false, integer | boolean $height = false ) : File Get object with resized parameters.
scaleCrop ( integer $width, integer $height, boolean $center = false ) : File Get object with cropped parameters.
store ( ) : array Store file.
updateInfo ( ) : array Update File info

비공개 메소드들

메소드 설명
__addPartCenter ( array $part, array $params ) : array Adds part with center for operations
__addPartEffect ( array $part, string $effect ) : array Adds part with effect for operations
__addPartFillColor ( array $part, array $params ) : array Adds part with fill color for operations
__addPartSize ( array $part, array $params ) : array Adds part with size for operations

메소드 상세

__construct() 공개 메소드

Constructs an object for CDN file with specified ID
public __construct ( string $uuid_or_url, Api $api, boolean | array | object $data = false )
$uuid_or_url string Uploadcare file UUID or CDN URL
$api Api Uploadcare class instance
$data boolean | array | object prepopulate this->cached_data

__get() 공개 메소드

public __get ( $name ) : array | null
$name
리턴 array | null

__toString() 공개 메소드

public __toString ( ) : string
리턴 string

copy() 공개 메소드

Copy the file.
public copy ( string $target = null ) : File | string
$target string Name of custom storage.
리턴 File | string

copyTo() 공개 메소드

Copy the file to custom storage.
public copyTo ( string $target ) : string
$target string Name of custom storage.
리턴 string

crop() 공개 메소드

Get object with cropped parameters.
public crop ( integer $width, integer $height, boolean $center = false, string | boolean $fill_color = false ) : File
$width integer Crop width
$height integer Crop height
$center boolean Center crop? true or false (default false).
$fill_color string | boolean Fill color. If nothing is provided just use false (default false).
리턴 File

delete() 공개 메소드

Delete file
public delete ( ) : array
리턴 array

effect() 공개 메소드

Apply effect
public effect ( string $effect ) : File
$effect string Effect name
리턴 File

getFileId() 공개 메소드

Get UUID
사용 중단:
public getFileId ( ) : string
리턴 string

getImgTag() 공개 메소드

Get image tag
public getImgTag ( string $postfix = null, array $attribs = [] ) : string
$postfix string File path postfix
$attribs array additional attributes
리턴 string

getUrl() 공개 메소드

Get url of original image
public getUrl ( string $postfix = null ) : string
$postfix string
리턴 string

getUuid() 공개 메소드

Get UUID
public getUuid ( )

op() 공개 메소드

Add any custom operation.
public op ( string $operation ) : File
$operation string
리턴 File

preview() 공개 메소드

Provide both width and height. If no width and height are provided exceptions will be thrown!
public preview ( integer $width, integer $height ) : File
$width integer Preview image width.
$height integer Preview image height.
리턴 File

resize() 공개 메소드

Provide width or height or both. If not width or height are provided exceptions will be thrown!
public resize ( integer | boolean $width = false, integer | boolean $height = false ) : File
$width integer | boolean Resized image width. Provide false if you resize proportionally.
$height integer | boolean Resized image height. Provide false if you resize proportionally.
리턴 File

scaleCrop() 공개 메소드

Get object with cropped parameters.
public scaleCrop ( integer $width, integer $height, boolean $center = false ) : File
$width integer Crop width
$height integer Crop height
$center boolean Center crop? true or false (default false).
리턴 File

store() 공개 메소드

Store file.
public store ( ) : array
리턴 array

updateInfo() 공개 메소드

Update File info
public updateInfo ( ) : array
리턴 array