Documentation

RestController
in package

Description of RestController

Tags
author

zozlak

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

Properties

$headers

private static array<string, array<string|int, string>> $headers

$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
string

getHeader()

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
string

getRangeHeader()

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
throws
RepoException
Return values
array<int, array<string, mixed>>|null

getRequestParameter()

public static getRequestParameter(string $purpose) : string|null
Parameters
$purpose : string
Return values
string|null

getRequestParameterAsArray()

public static getRequestParameterAsArray(string $purpose) : array<string|int, string>
Parameters
$purpose : string
Return values
array<string|int, string>

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>>

        
On this page

Search results