Documentation

Resource
in package

Description of Resource

Tags
author

zozlak

Table of Contents

Constants

DEFAULT_MAX_FILE_SIZE_MB  = 100
REAL_URL_PROP  = 'http://real/url'

Properties

$config  : object
$defaultHandler  : HandlerInterface
$handlers  : array<string|int, HandlerInterface>
$log  : LoggerInterface|null
$meta  : ResourceMeta
$tmpId  : string

Methods

__construct()  : mixed
cacheHandler()  : ResponseCacheItem
Gets the requested repository resource metadata and converts it to the thumbnail's service ResourceMeta object.
getMeta()  : ResourceMeta
getRefFilePath()  : string
Returns the path to the full resolution image.
getThumbnailPath()  : string
fetchResourceBinary()  : void
Fetches original resource
generateThumbnail()  : void
getFilePath()  : string
Returns expected cached file location (doesn't assure such a file exists).
initHandlers()  : void

Constants

DEFAULT_MAX_FILE_SIZE_MB

public mixed DEFAULT_MAX_FILE_SIZE_MB = 100

REAL_URL_PROP

public mixed REAL_URL_PROP = 'http://real/url'

Properties

Methods

__construct()

public __construct(ResourceMeta $meta, object $config, LoggerInterface|null $log) : mixed
Parameters
$meta : ResourceMeta
$config : object
$log : LoggerInterface|null

cacheHandler()

Gets the requested repository resource metadata and converts it to the thumbnail's service ResourceMeta object.

public static cacheHandler(RepoResourceInterface $res, array<string|int, mixed> $param, object $schema[, LoggerInterface|null $log = null ]) : ResponseCacheItem
Parameters
$res : RepoResourceInterface
$param : array<string|int, mixed>
$schema : object
$log : LoggerInterface|null = null
Return values
ResponseCacheItem

getRefFilePath()

Returns the path to the full resolution image.

public getRefFilePath() : string

Downloads the resource content if needed.

Return values
string

getThumbnailPath()

public getThumbnailPath(int $width, int $height) : string
Parameters
$width : int
$height : int
Return values
string

fetchResourceBinary()

Fetches original resource

private fetchResourceBinary(string $path) : void
Parameters
$path : string
Tags
throws
FileToLargeException

generateThumbnail()

private generateThumbnail(string $path, string $refPath, int $width, int $height) : void
Parameters
$path : string
$refPath : string
$width : int
$height : int

getFilePath()

Returns expected cached file location (doesn't assure such a file exists).

private getFilePath([int $width = 0 ][, int $height = 0 ]) : string
Parameters
$width : int = 0
$height : int = 0
Return values
string

initHandlers()

private initHandlers() : void

        
On this page

Search results