Properties

$path

$path :array

The absolute path split from request

Type

array

$relation

$relation :null|integer

The private relation number Is set in case of detail content relation requests

Type

null|integer

$user_groups

$user_groups :null

Storage for user groups

Type

null

$folder

$folder :string

The absolute folder path

Type

string—Is defined for content requests

$method

$method :string

The http request method

Type

string

$plain_path

$plain_path :string

the plain path

Type

string

$original_path

$original_path :string

the original url

Type

string

$file

$file :mixed|string

The file name

Type

mixed|string

$inbound

$inbound :null

The buffer for the inbound payload

Type

null

$query

$query :array

List of query parameters

Type

array

$git_repo

$git_repo :\FAA\Git|null

The repository instance

Type

\FAA\Git|null

$language

$language :string|null

The request language, either from first segment or,from optimizer table

Type

string|null

$languages

$languages :array

The local active language buffer

Type

array

$body

$body :null|array

The parsed request body

Type

null|array

$args

$args :null

The interface arguments from url

Is filled in case of rest interface call

Type

null

$host

$host :mixed|null

Buffer for the hostname

Type

mixed|null

$domain

$domain :null

the system domain

Type

null

$is_directory

$is_directory :boolean

Flag is most likely a directory call

Type

boolean

$is_api

$is_api :boolean

Flag is some sort of api call

Type

boolean

$handler

$handler :null|\FAA\Interfaces\ServerPlugin

Custom handler

A handler serving the request and returning a defined response object. May be set in plugin context

Type

null|\FAA\Interfaces\ServerPlugin

Methods

__construct()

__construct(string  $url)

Simple main constructor, parses the request and specifies the targeted type

Parameters

string $url

Http request url

ContextType()

ContextType(): string

The context type

Returns

string

LogLine()

LogLine(mixed  $value,string  $level = FAA_LOG_LEVEL_INFO): boolean

log line write a line to the local system logfile

Parameters

mixed $value

The log message

string $level

The log level

Returns

boolean —

Write success or false on error

Protocol()

Protocol(): string

Expose the request protocol as string

Returns

string

OriginalPath()

OriginalPath(boolean  $decode = false): string

Expose the original request url

Parameters

boolean $decode

Returns

string

Hostname()

Hostname(): string|null

Expose the host of this request

Returns

string|null

Origin()

Origin(): string

Get origin Return the value of the set origin header

Returns

string —

The value of the origin header

CurrentDomain()

CurrentDomain(): \FAA\Obj\Domain

Get the current domain object.

Returns

\FAA\Obj\Domain

A domain object

RegisterCustomHandler()

RegisterCustomHandler(\FAA\Interfaces\ServerPlugin  $handler)

Register a system plugin or a child of with ServeRequest method

Parameters

\FAA\Interfaces\ServerPlugin $handler

A system plugin

HasCustomHandler()

HasCustomHandler(): boolean

Has custom handler

Check if a custom handler is registered for this request Could be the case if a plugin will serve the request

Returns

boolean —

Has handler

ServeRequest()

ServeRequest(): \FAA\Obj\Response

Serve custom request Serve the request using the registered custom handler

Returns

\FAA\Obj\Response —

A system response object

Id()

Id(): string

Generate Id A unique request identifier based on folder, language and requester groups.

Can be used in caching relations when permission and folder is relevant. E.g. in navigation renderer.

Returns

string —

the 32 character request id

GetUserGroups()

GetUserGroups(): array|null

Get user groups Get the user groups of the requesting user. Will contain the visitor group for users without session.

Returns

array|null —

List of user group id's and visitor group

Repository()

Repository(): \FAA\Git

Get the git instance

It should open a git instance on demand

Returns

\FAA\Git

GetLanguage()

GetLanguage(string  $format = ''): string

get language expose a reference to the current language

Parameters

string $format

If set to iso, the code wil be extended to e.g. de_DE

Returns

string —

The local request language

GetRelation()

GetRelation(): integer|null

get the relation id expose a reference to the current loaded relation

Returns

integer|null —

The local request relation id or null

GetLanguageList()

GetLanguageList(): array<mixed,string>

get language list expose a reference to the current loaded language list

Returns

array<mixed,string> —

the local request language list

GetAcceptLanguageList()

GetAcceptLanguageList(): array<mixed,string>

get accept language list expose a reference to the external given language list

Returns

array<mixed,string> —

the local request language list

GetQuery()

GetQuery(string|null  $item = null): array|mixed|null

Get query Get the query or a part of the query

Parameters

string|null $item

A certain item

Returns

array|mixed|null

GetFolder()

GetFolder(boolean  $clear = false): string

Get local requested folder component of url

Expose a reference to the current folder, can clear the folder name so it can be used as an id

Parameters

boolean $clear

Clear path on demand

Returns

string —

The local request folder

GetFile()

GetFile(): string

get local requested file component od url expose a reference to the current file

Returns

string —

the local request file

GetPath()

GetPath(boolean  $decode = false): string

get REST end point plain this method provides reading access to the REST url

Parameters

boolean $decode

Returns

string —

the end point as string

RequestMethod()

RequestMethod(): string

Get method Get the buffered http request method string e.g. POST, GET, PUT

Returns

string —

The request method

GetBody()

GetBody(boolean  $parsed = true): string|array|\FAA\Obj\Result

get request body content this method provides reading access payload of the request

Parameters

boolean $parsed

When set to true, return as parsed json payload

Returns

string|array|\FAA\Obj\Result —

The payload as string or a system result object

TrimInterfaceArgs()

TrimInterfaceArgs(  $length): array

Remove parts of the request path based on given length

Parameters

$length

Returns

array

Header()

Header(string  $string): mixed|null

Get header from request

Parameters

string $string

Returns

mixed|null

GetInterfaceArgs()

GetInterfaceArgs(boolean|integer  $index = false): array|string

get REST end point components this method rebuilds the original call and provides the components as array

Parameters

boolean|integer $index

When set > 1 function will return the element at offset

Returns

array|string —

The end point as array or a single component

GetInterfaceArg()

GetInterfaceArg(  $index,  $format = FAA_REQUEST_ARG_FORMAT_NONE): array|integer|string

Get part of the request url

Parameters

$index

int

$format

Returns

array|integer|string —

The interface argument parsed

InboundData()

InboundData(): string|null

Get inbound data

Returns

string|null

ImageTag()

ImageTag(\stdClass|\FAA\Obj\Generic\Asset  $content,string  $size,string  $tpl = '',boolean  $absolute = false): string

create an image tag map the given content to a image tag (or what the template defines)

Parameters

\stdClass|\FAA\Obj\Generic\Asset $content

A system object content or an asset object

string $size

A registered image type

string $tpl

The output template, replacements are {url} and {title}

boolean $absolute

Return including url

Returns

string —

A html content

FolderLink()

FolderLink(string  $folder,string  $title,mixed  $tpl = '',boolean  $blank = false,string  $lang = ''): string

create a folder link tag map the given content to a image tag (or what the template defines)

Parameters

string $folder

The path to link onto

string $title

A title for the link

mixed $tpl

The output template, replacements are {href} and {title}

boolean $blank

Set target to blank on demand

string $lang

The language to use for this link, default is the local language

Returns

string —

The parsed template

ContentLink()

ContentLink(\FAA\Obj\Generic\Folder  $folder,\stdClass  $content,string  $title = '',string  $tpl = ''): string

create a content link tag map the given content to a a tag (or what the template defines)

Parameters

\FAA\Obj\Generic\Folder $folder

A system folder object

\stdClass $content

A plain content entry

string $title

A title for the link

string $tpl

The output template, replacements are {href} and {title}

Returns

string —

The parsed template

CanonicalLink()

CanonicalLink(string  $host = '',string  $template = '<link rel="canonical" href="{ur' . 'l}" />',boolean  $skip_self = true): string

create a canonical link tag search the linked list and return the first system link as canonical url

Parameters

string $host

The master domain of the system

string $template

The template to parse the found link into

boolean $skip_self

Check if the request context is the same, than return null

Returns

string —

The link element

readInboundStream()

readInboundStream(): string

read body load the post body into a string

Returns

string —

the parsed body as string

loadLanguages()

loadLanguages()

load languages

load the system languages to a local structure this method is mostly used for caching purpose and mathing locales by key

detectDomain()

detectDomain()

Detect current domain

Load the system domains to a local structure this method is mostly used for caching purpose and mathing domains by key

fixHomePath()

fixHomePath()

Correct the request path set a redirect header to the given location

read()

read()