MediaHelper
in package
Table of Contents
- PREVIEW_MAX_SIZE = 384
- PUBLIC_DIRECTORY = '/media/'
- filterByMimeType() : array<string|int, mixed>
- fixImageRotation() : void
- generateFiles() : void
- generateImagePreview() : void
- getBucketPath() : string
- Convert the public link to the file in the bucket.
- getFilesInDirectory() : array<string|int, mixed>
- getHref() : array<string|int, mixed>
- getHrefs() : array<string|int, mixed>
- getPublicHref() : string
- Convert path for file in the bucket to the public link.
- saveToS3() : array<string|int, mixed>
- removeImageRotation() : void
Constants
PREVIEW_MAX_SIZE
public
mixed
PREVIEW_MAX_SIZE
= 384
PUBLIC_DIRECTORY
public
mixed
PUBLIC_DIRECTORY
= '/media/'
Methods
filterByMimeType()
public
static filterByMimeType(array<string|int, TmpFile> $tmpFiles) : array<string|int, mixed>
Parameters
- $tmpFiles : array<string|int, TmpFile>
Return values
array<string|int, mixed> —fixImageRotation()
public
static fixImageRotation(Filesystem $filesystem, string $imagePath) : void
Parameters
- $filesystem : Filesystem
- $imagePath : string
Tags
Return values
void —generateFiles()
public
static generateFiles(Filesystem $filesystem, array<string|int, mixed> $href) : void
Parameters
- $filesystem : Filesystem
- $href : array<string|int, mixed>
Tags
Return values
void —generateImagePreview()
public
static generateImagePreview(Filesystem $filesystem, string $srcPath, string $destPath) : void
Parameters
- $filesystem : Filesystem
- $srcPath : string
- $destPath : string
Tags
Return values
void —getBucketPath()
Convert the public link to the file in the bucket.
public
static getBucketPath(string $href) : string
Parameters
- $href : string
Return values
string —getFilesInDirectory()
public
static getFilesInDirectory(Filesystem $filesystem, string $path) : array<string|int, mixed>
Parameters
- $filesystem : Filesystem
- $path : string
Tags
Return values
array<string|int, mixed> —getHref()
public
static getHref(string $path, string $file, string $type) : array<string|int, mixed>
Parameters
- $path : string
- $file : string
- $type : string
Return values
array<string|int, mixed> —getHrefs()
public
static getHrefs(string $path, array<string|int, mixed> $files) : array<string|int, mixed>
Parameters
- $path : string
- $files : array<string|int, mixed>
Return values
array<string|int, mixed> —getPublicHref()
Convert path for file in the bucket to the public link.
public
static getPublicHref(string $path) : string
Parameters
- $path : string
Return values
string —saveToS3()
public
static saveToS3(File $file, Filesystem $filesystem, ObjectId $id) : array<string|int, mixed>
Parameters
- $file : File
- $filesystem : Filesystem
- $id : ObjectId
Tags
Return values
array<string|int, mixed> —removeImageRotation()
private
static removeImageRotation(Imagick $image) : void
Parameters
- $image : Imagick