OGCRequest
in package
Tags
Table of Contents
Properties
- $appContext : AppContextInterface
- $params : array<string|int, mixed>
- $project : Project
- $repository : Repository
- $requestXml : null|string
- $services : lizmapServices
- $tplExceptions : string
Methods
- __construct() : mixed
- constructor.
- param() : mixed
- Get the value of a request parameter. If not defined, gets its default value.
- parameters() : array<string|int, mixed>
- Provide the parameters with the lizmap extra parameters for filtering the request.
- process() : object
- Process the OGC Request Checks the request parameter and performs the right method.
- constructUrl() : string
- Build the URL to request QGIS Server.
- loadXmlString() : mixed
- logRequestIfError() : mixed
- Log if the HTTP code is a 4XX or 5XX error code.
- process_getcapabilities() : OGCResponse
- Perform an OGC GetCapabilities Request.
- request() : OGCResponse
- Request QGIS Server.
- serviceException() : OGCResponse
- Provide an OGC Service Exception result.
- formatHttpErrorString() : string
- Generate a string to identify the target of the HTTP request.
Properties
$appContext
protected
AppContextInterface
$appContext
$params
protected
array<string|int, mixed>
$params
$project
protected
Project
$project
$repository
protected
Repository
$repository
$requestXml
protected
null|string
$requestXml
$services
protected
lizmapServices
$services
$tplExceptions
protected
string
$tplExceptions
selector of a template
Methods
__construct()
constructor.
public
__construct(Project $project, array<string|int, mixed> $params, lizmapServices $services[, null|string $requestXml = null ]) : mixed
Parameters
- $project : Project
-
the project
- $params : array<string|int, mixed>
-
the params array
- $services : lizmapServices
- $requestXml : null|string = null
-
the params array
param()
Get the value of a request parameter. If not defined, gets its default value.
public
param(string $name[, mixed $defaultValue = null ][, bool $useDefaultIfEmpty = false ]) : mixed
Parameters
- $name : string
-
the name of the request parameter
- $defaultValue : mixed = null
-
the default returned value if the parameter doesn't exists
- $useDefaultIfEmpty : bool = false
-
true: says to return the default value if the parameter value is ""
Return values
mixed —the request parameter value
parameters()
Provide the parameters with the lizmap extra parameters for filtering the request.
public
parameters() : array<string|int, mixed>
Lizmap_User, Lizmap_User_Groups, Lizmap_Override_Filter have been added to the OGC request parameters.
Return values
array<string|int, mixed> —the OGC request parameters with Lizmap extra parameters for filtering request
process()
Process the OGC Request Checks the request parameter and performs the right method.
public
process() : object
Return values
object —The request result with HTTP code, response mime-type, response data (properties $code, $mime, $data, $cached)
constructUrl()
Build the URL to request QGIS Server.
protected
constructUrl() : string
Return values
string —The URL to use to request QGIS Server
loadXmlString()
protected
loadXmlString(mixed $xmldata, mixed $name) : mixed
Parameters
- $xmldata : mixed
- $name : mixed
logRequestIfError()
Log if the HTTP code is a 4XX or 5XX error code.
protected
logRequestIfError(int $code) : mixed
Parameters
- $code : int
-
The HTTP code of the request
process_getcapabilities()
Perform an OGC GetCapabilities Request.
protected
process_getcapabilities() : OGCResponse
Return values
OGCResponse —The request result with HTTP code, response mime-type, response data (properties $code, $mime, $data, $cached)
request()
Request QGIS Server.
protected
request([bool $post = false ][, bool $stream = false ]) : OGCResponse
Parameters
- $post : bool = false
-
Force to use POST request
- $stream : bool = false
-
Get data as stream
Return values
OGCResponse —The request result with HTTP code, response mime-type and response data (properties $code, $mime, $data)
serviceException()
Provide an OGC Service Exception result.
protected
serviceException([int $code = 400 ]) : OGCResponse
Parameters
- $code : int = 400
-
The HTTP code to return
Return values
OGCResponse —The request result with HTTP code, response mime-type, response data (properties $code, $mime, $data, $cached)
formatHttpErrorString()
Generate a string to identify the target of the HTTP request.
private
formatHttpErrorString(array<string|int, mixed> $parameters, int $code) : string
Parameters
- $parameters : array<string|int, mixed>
-
The list of HTTP parameters in the query
- $code : int
-
The HTTP code of the request
Return values
string —The string to identify the HTTP request, with main OGC parameters first such as MAP, SERVICE...