RestController
in package
Description of RestController
Tags
Table of Contents
Constants
- ACCESS_READ = 1
- ACCESS_WRITE = 2
- CORS_ORIGIN = '__origin__'
- ID_CREATE = 0
- TRIPLES_CACHE_DEFAULT = 1000
Properties
- $auth : Auth
- $config : Config
- $handlersCtl : HandlersController
- $log : Log
- $logId : int
- $pdo : PDO
- $resource : Resource
- $schema : Schema
- $transaction : Transaction
- $headers : array<string, array<string|int, string>>
- $output : string|OutputFile|MetadataReadOnly
- $outputFormats : array<string, string>
- $requestParam : array<string, string>
Methods
- addHeader() : void
- appendOutput() : void
- getBaseUrl() : string
- getHeader() : array<string|int, string>
- getHttpHeaderName() : string
- getRangeHeader() : array<int, array<string, mixed>>|null
- Returns HTTP Range header parsed into array of requested ranges.
- getRequestParameter() : string|null
- getRequestParameterAsArray() : array<string|int, string>
- handleRequest() : void
- init() : void
- setHeader() : void
- setHeaders() : void
- setOutput() : void
- logFinalStatus() : void
- sendOutput() : void
Constants
ACCESS_READ
public
mixed
ACCESS_READ
= 1
ACCESS_WRITE
public
mixed
ACCESS_WRITE
= 2
CORS_ORIGIN
public
mixed
CORS_ORIGIN
= '__origin__'
ID_CREATE
public
mixed
ID_CREATE
= 0
TRIPLES_CACHE_DEFAULT
public
mixed
TRIPLES_CACHE_DEFAULT
= 1000
Properties
$auth
public
static Auth
$auth
$config
public
static Config
$config
$handlersCtl
public
static HandlersController
$handlersCtl
$log
public
static Log
$log
$logId
public
static int
$logId
$pdo
public
static PDO
$pdo
$resource
public
static Resource
$resource
$schema
public
static Schema
$schema
$transaction
public
static Transaction
$transaction
$headers
private
static array<string, array<string|int, string>>
$headers
$output
private
static string|OutputFile|MetadataReadOnly
$output
$outputFormats
private
static array<string, string>
$outputFormats
= ['text/turtle' => 'text/turtle', 'application/rdf+xml' => 'application/rdf+xml', 'application/n-triples' => 'application/n-triples', 'application/ld+json' => 'application/ld+json', '*/*' => 'text/turtle', 'text/*' => 'text/turtle', 'application/*' => 'application/n-triples']
$requestParam
private
static array<string, string>
$requestParam
= ['metadataReadMode' => 'readMode', 'metadataParentProperty' => 'parentProperty', 'metadataWriteMode' => 'writeMode', 'transactionId' => 'transactionId', 'withReferences' => 'withReferences', 'resourceProperties' => 'resourceProperties', 'relativesProperties' => 'relativesProperties']
Methods
addHeader()
public
static addHeader(string $header, string $value) : void
Parameters
- $header : string
- $value : string
appendOutput()
public
static appendOutput(string $output) : void
Parameters
- $output : string
getBaseUrl()
public
static getBaseUrl() : string
Return values
stringgetHeader()
public
static getHeader(string $header) : array<string|int, string>
Parameters
- $header : string
Return values
array<string|int, string>getHttpHeaderName()
public
static getHttpHeaderName(string $purpose) : string
Parameters
- $purpose : string
Return values
stringgetRangeHeader()
Returns HTTP Range header parsed into array of requested ranges.
public
static getRangeHeader() : array<int, array<string, mixed>>|null
Throws HTTP 416 on basic Range header errors (unit other then "bytes", negative position, end lower then start).
Important remark - if multiple ranges are requested, it clears the
"Content-Type" and "Content-Length" headers so they aren't emitted before
the self::$output->sendOutput()
is called.
Tags
Return values
array<int, array<string, mixed>>|nullgetRequestParameter()
public
static getRequestParameter(string $purpose) : string|null
Parameters
- $purpose : string
Return values
string|nullgetRequestParameterAsArray()
public
static getRequestParameterAsArray(string $purpose) : array<string|int, string>
Parameters
- $purpose : string
Return values
array<string|int, string>handleRequest()
public
static handleRequest() : void
init()
public
static init(string $configFile, ClassLoader $loader) : void
Parameters
- $configFile : string
- $loader : ClassLoader
setHeader()
public
static setHeader(string $header, string $value) : void
Parameters
- $header : string
- $value : string
setHeaders()
public
static setHeaders(array<string, string|array<string|int, string>> $headers) : void
Parameters
- $headers : array<string, string|array<string|int, string>>
setOutput()
public
static setOutput(string|OutputFile|MetadataReadOnly $output[, string|null $mimeType = null ]) : void
Parameters
- $output : string|OutputFile|MetadataReadOnly
- $mimeType : string|null = null
logFinalStatus()
private
static logFinalStatus() : void
sendOutput()
private
static sendOutput() : void