PHP 클래스 BookStack\Services\ImageService

상속: extends UploadService
파일 보기 프로젝트 열기: ssddanbrown/bookstack

보호된 프로퍼티들

프로퍼티 타입 설명
$cache
$imageTool
$storageUrl

공개 메소드들

메소드 설명
__construct ( Intervention\Image\ImageManager $imageTool, Illuminate\Contracts\Filesystem\Factory $fileSystem, Illuminate\Contracts\Cache\Repository $cache ) ImageService constructor.
destroyImage ( Image $image ) : boolean Destroys an Image object along with its files and thumbnails.
getThumbnail ( Image $image, integer $width = 220, integer $height = 220, boolean $keepRatio = false ) : string Get the thumbnail for an image.
saveNewFromUpload ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, string $type, integer $uploadedTo ) : mixed Saves a new image from an upload.
saveUserGravatar ( User $user, integer $size = 500 ) : mixed Save a gravatar image and set a the profile image for a user.

보호된 메소드들

메소드 설명
getPath ( Image $image ) : mixed | string Get the storage path, Dependant of storage type.

비공개 메소드들

메소드 설명
getPublicUrl ( string $filePath ) : string Gets a public facing url for an image by checking relevant environment variables.
saveNew ( string $imageName, string $imageData, string $type, integer $uploadedTo ) : Image Saves a new image
saveNewFromUrl ( $url, string $type, boolean | string $imageName = false ) : mixed Gets an image from url and saves it to the database.

메소드 상세

__construct() 공개 메소드

ImageService constructor.
public __construct ( Intervention\Image\ImageManager $imageTool, Illuminate\Contracts\Filesystem\Factory $fileSystem, Illuminate\Contracts\Cache\Repository $cache )
$imageTool Intervention\Image\ImageManager
$fileSystem Illuminate\Contracts\Filesystem\Factory
$cache Illuminate\Contracts\Cache\Repository

destroyImage() 공개 메소드

Destroys an Image object along with its files and thumbnails.
public destroyImage ( Image $image ) : boolean
$image BookStack\Image
리턴 boolean

getPath() 보호된 메소드

Get the storage path, Dependant of storage type.
protected getPath ( Image $image ) : mixed | string
$image BookStack\Image
리턴 mixed | string

getThumbnail() 공개 메소드

If $keepRatio is true only the width will be used. Checks the cache then storage to avoid creating / accessing the filesystem on every check.
public getThumbnail ( Image $image, integer $width = 220, integer $height = 220, boolean $keepRatio = false ) : string
$image BookStack\Image
$width integer
$height integer
$keepRatio boolean
리턴 string

saveNewFromUpload() 공개 메소드

Saves a new image from an upload.
public saveNewFromUpload ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, string $type, integer $uploadedTo ) : mixed
$uploadedFile Symfony\Component\HttpFoundation\File\UploadedFile
$type string
$uploadedTo integer
리턴 mixed

saveUserGravatar() 공개 메소드

Save a gravatar image and set a the profile image for a user.
public saveUserGravatar ( User $user, integer $size = 500 ) : mixed
$user BookStack\User
$size integer
리턴 mixed

프로퍼티 상세

$cache 보호되어 있는 프로퍼티

protected $cache

$imageTool 보호되어 있는 프로퍼티

protected $imageTool

$storageUrl 보호되어 있는 프로퍼티

protected $storageUrl