Resource
in package
Description of Resource
Tags
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
$config
private
object
$config
$defaultHandler
private
HandlerInterface
$defaultHandler
$handlers
private
array<string|int, HandlerInterface>
$handlers
= []
$log
private
LoggerInterface|null
$log
$meta
private
ResourceMeta
$meta
$tmpId
private
string
$tmpId
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
ResponseCacheItemgetMeta()
public
getMeta() : ResourceMeta
Return values
ResourceMetagetRefFilePath()
Returns the path to the full resolution image.
public
getRefFilePath() : string
Downloads the resource content if needed.
Return values
stringgetThumbnailPath()
public
getThumbnailPath(int $width, int $height) : string
Parameters
- $width : int
- $height : int
Return values
stringfetchResourceBinary()
Fetches original resource
private
fetchResourceBinary(string $path) : void
Parameters
- $path : string
Tags
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
stringinitHandlers()
private
initHandlers() : void