Resolver
in package
Resolves an URI being defined as an identifier of a repository object to the proper dissemination method.
Tags
Table of Contents
Constants
- FORMAT_LIST_SERVICES = '__list__'
Properties
Methods
- __construct() : mixed
- resolve() : void
- Performs the resolution
- checkAccessRights() : void
- Checks if a client is able to access a given URI.
- checkFastTrack() : bool
- Checks a fast resolution track "match on mime and appent a suffix to the resource URL".
- findDissService() : ServiceInterface|null
- findResource() : RepoResourceInterface
- Finds a repository resource which corresponds to a given URI
- getResourceId() : string
- Returns id of a resource to be resolved (based on the HTTP request).
- listDissServices() : void
- redirect() : void
- sanitizeAcceptHeader() : string
- Sanitizes requested output format by applying following rules: - `format` request query parameter overwrites whole HTTP Accept header - the wildcard is turned into the default dissemination service - for a CMDI requests format mappings defined in cfg.resolver.cmdi.formatMappings are applied
Constants
FORMAT_LIST_SERVICES
public
mixed
FORMAT_LIST_SERVICES
= '__list__'
Properties
$debug
public
static bool
$debug
= false
$config
private
object
$config
$log
private
Log
$log
Methods
__construct()
public
__construct(object $config) : mixed
Parameters
- $config : object
resolve()
Performs the resolution
public
resolve() : void
checkAccessRights()
Checks if a client is able to access a given URI.
private
checkAccessRights(string $uri) : void
Parameters
- $uri : string
-
URI to be checked
Tags
checkFastTrack()
Checks a fast resolution track "match on mime and appent a suffix to the resource URL".
private
checkFastTrack(RepoResourceInterface $res) : bool
The list of {mime type, URL suffix} pairs is read from the config.
Parameters
- $res : RepoResourceInterface
-
repository resource to be disseminated
Return values
boolfindDissService()
private
findDissService(RepoResourceInterface $res) : ServiceInterface|null
Parameters
- $res : RepoResourceInterface
Return values
ServiceInterface|nullfindResource()
Finds a repository resource which corresponds to a given URI
private
findResource(string $resId) : RepoResourceInterface
Parameters
- $resId : string
-
URI to be mapped to a repository resource
Tags
Return values
RepoResourceInterfacegetResourceId()
Returns id of a resource to be resolved (based on the HTTP request).
private
getResourceId() : string
Return values
stringlistDissServices()
private
listDissServices(RepoResourceInterface $res) : void
Parameters
- $res : RepoResourceInterface
redirect()
private
redirect(string $url) : void
Parameters
- $url : string
sanitizeAcceptHeader()
Sanitizes requested output format by applying following rules: - `format` request query parameter overwrites whole HTTP Accept header - the wildcard is turned into the default dissemination service - for a CMDI requests format mappings defined in cfg.resolver.cmdi.formatMappings are applied
private
sanitizeAcceptHeader(bool $isCmdi) : string
Parameters
- $isCmdi : bool
-
is CMDI id requested?
Return values
string —sanitized Accept header value