LocalFile
extends AbstractCover
in package
Local file cover content loader.
Tags
Table of Contents
- $allowedMimeTypes : array<string|int, mixed>
- MIME types allowed to be loaded from disk.
- $cacheAllowed : bool
- Are we allowed to cache images from this source?
- $directUrls : bool
- Use direct urls as image urls. When set to true, direct urls to content cover provider will be used in interface instead internal Cover/Show urls.
- $imageExtensions : array<string|int, mixed>
- Image file extensions to look for when using %anyimage% token.
- $imageSizes : array<string|int, mixed>
- Image sizes to look for when using %size% token.
- $mandatoryBacklinkLocations : array<string|int, mixed>
- Are backlinks to source of cover mandatory?
- $supportsIsbn : bool
- Does this plugin support ISBNs?
- $supportsIsmn : bool
- Does this plugin support ISMNs?
- $supportsIssn : bool
- Does this plugin support ISSNs?
- $supportsNbn : bool
- Does this plugin support national bibliographies number?
- $supportsOclc : bool
- Does this plugin support OCLC numbers?
- $supportsRecordid : bool
- Does this plugin support getting cover by local id?
- $supportsUpc : bool
- Does this plugin support UPC numbers?
- $supportsUuid : bool
- Does this plugin support getting cover by UUID (Universally unique identifier)?
- getMandatoryBacklinkLocations() : array<string|int, mixed>
- Which location are mandatory for backlinks, available locations are the same as used for cover size determination, see coversize setting in [Content] section of config.ini
- getMetadata() : array<string|int, mixed>
- Get cover metadata for a particular API key and set of IDs (or empty array).
- getUrl() : string|bool
- Get image location from local file storage.
- isCacheAllowed() : bool
- Are we allowed to cache images from this source?
- supports() : bool
- Does this plugin support the provided ID array?
- useDirectUrls() : bool
- Use direct urls? (Or proxied urls)
- replaceEnvironmentSizeAndIdTokens() : string
- Convert tokens to appropriate values from environment, size parameter and ID array values.
- replaceImageTypeTokens() : string
- Convert tokens to image type file extension.
Properties
$allowedMimeTypes
MIME types allowed to be loaded from disk.
protected
array<string|int, mixed>
$allowedMimeTypes
= ['image/gif', 'image/jpeg', 'image/png', 'image/tiff']
$cacheAllowed
Are we allowed to cache images from this source?
protected
bool
$cacheAllowed
= false
$directUrls
Use direct urls as image urls. When set to true, direct urls to content cover provider will be used in interface instead internal Cover/Show urls.
protected
bool
$directUrls
= false
$imageExtensions
Image file extensions to look for when using %anyimage% token.
protected
array<string|int, mixed>
$imageExtensions
= ['gif', 'jpg', 'jpeg', 'png', 'tif', 'tiff']
$imageSizes
Image sizes to look for when using %size% token.
protected
array<string|int, mixed>
$imageSizes
= ['small', 'medium', 'large']
$mandatoryBacklinkLocations
Are backlinks to source of cover mandatory?
protected
array<string|int, mixed>
$mandatoryBacklinkLocations
= []
$supportsIsbn
Does this plugin support ISBNs?
protected
bool
$supportsIsbn
= false
$supportsIsmn
Does this plugin support ISMNs?
protected
bool
$supportsIsmn
= false
$supportsIssn
Does this plugin support ISSNs?
protected
bool
$supportsIssn
= false
$supportsNbn
Does this plugin support national bibliographies number?
protected
bool
$supportsNbn
= false
$supportsOclc
Does this plugin support OCLC numbers?
protected
bool
$supportsOclc
= false
$supportsRecordid
Does this plugin support getting cover by local id?
protected
bool
$supportsRecordid
= false
$supportsUpc
Does this plugin support UPC numbers?
protected
bool
$supportsUpc
= false
$supportsUuid
Does this plugin support getting cover by UUID (Universally unique identifier)?
protected
bool
$supportsUuid
= false
Methods
getMandatoryBacklinkLocations()
Which location are mandatory for backlinks, available locations are the same as used for cover size determination, see coversize setting in [Content] section of config.ini
public
getMandatoryBacklinkLocations() : array<string|int, mixed>
Return values
array<string|int, mixed> —getMetadata()
Get cover metadata for a particular API key and set of IDs (or empty array).
public
getMetadata(string $key, string $size, array<string|int, mixed> $ids) : array<string|int, mixed>
Parameters
- $key : string
-
API key
- $size : string
-
Size of image to load (small/medium/large)
- $ids : array<string|int, mixed>
-
Associative array of identifiers (keys may include 'isbn' pointing to an ISBN object, 'issn' pointing to a string and 'oclc' pointing to an OCLC number string)
Return values
array<string|int, mixed> —Array with keys: url, backlink_url, backlink_text
getUrl()
Get image location from local file storage.
public
getUrl(string $key, string $size, array<string|int, mixed> $ids) : string|bool
Parameters
- $key : string
-
local file directory path
- $size : string
-
Size of image to load (small/medium/large)
- $ids : array<string|int, mixed>
-
Associative array of identifiers (keys may include 'isbn' pointing to an ISBN object and 'issn' pointing to a string)
Return values
string|bool —isCacheAllowed()
Are we allowed to cache images from this source?
public
isCacheAllowed() : bool
Return values
bool —supports()
Does this plugin support the provided ID array?
public
supports(array<string|int, mixed> $ids) : bool
Parameters
- $ids : array<string|int, mixed>
-
IDs that will later be sent to load() -- see below.
Return values
bool —useDirectUrls()
Use direct urls? (Or proxied urls)
public
useDirectUrls() : bool
Return values
bool —replaceEnvironmentSizeAndIdTokens()
Convert tokens to appropriate values from environment, size parameter and ID array values.
protected
replaceEnvironmentSizeAndIdTokens(string $filePath, array<string|int, mixed> $ids, string $size) : string
Parameters
- $filePath : string
-
file path of image file
- $ids : array<string|int, mixed>
-
Associative array of identifiers (keys may include 'isbn' pointing to an ISBN object and 'issn' pointing to a string)
- $size : string
-
size of image (small/medium/large)
Return values
string —replaceImageTypeTokens()
Convert tokens to image type file extension.
protected
replaceImageTypeTokens(string $fileName) : string
Parameters
- $fileName : string
-
file path of image file