Bokinfo
extends AbstractCover
in package
implements
LoggerAwareInterface, HttpServiceAwareInterface
Uses
LoggerAwareTrait, HttpServiceAwareTrait
Plugin for Bokinfo coverimages
Tags
Interfaces, Classes, Traits and Enums
- LoggerAwareInterface
- HttpServiceAwareInterface
Table of Contents
- $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.
- $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)?
- __construct() : mixed
- Constructor
- 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 URL for a particular API key and set of IDs (or false if invalid).
- 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)
- createHttpClient() : HttpClient
- Return a HTTP Client object
- debug() : void
- Log a debug message.
- getImageUrl() : string
- Find the image url in the XML returned from API
- log() : void
- Send a message to the logger.
- logError() : void
- Log an error message.
- logWarning() : void
- Log a warning message.
- testUrlFunction() : bool
- Test that the url is really working
Properties
$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
$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
__construct()
Constructor
public
__construct() : mixed
Return values
mixed —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 URL for a particular API key and set of IDs (or false if invalid).
public
getUrl(string $key, string $size, array<string|int, mixed> $ids) : string|bool
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 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 —createHttpClient()
Return a HTTP Client object
protected
createHttpClient(string $url) : HttpClient
Parameters
- $url : string
-
API Url
Return values
HttpClient —Http Client
debug()
Log a debug message.
protected
debug(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
- $msg : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = true
-
Prepend class name to message?
Return values
void —getImageUrl()
Find the image url in the XML returned from API
protected
getImageUrl(string $rawXML) : string
Parameters
- $rawXML : string
-
XML returned from API
Return values
string —url of the image
log()
Send a message to the logger.
protected
log(string $level, string $message[, array<string|int, mixed> $context = [] ][, bool $prependClass = false ]) : void
Parameters
- $level : string
-
Log level
- $message : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = false
-
Prepend class name to message?
Return values
void —logError()
Log an error message.
protected
logError(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
- $msg : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = true
-
Prepend class name to message?
Return values
void —logWarning()
Log a warning message.
protected
logWarning(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
- $msg : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = true
-
Prepend class name to message?
Return values
void —testUrlFunction()
Test that the url is really working
protected
testUrlFunction(string $url) : bool
Parameters
- $url : string
-
image Url
Return values
bool —Http Client