Documentation

request
in package

HTTP request handler object

Tags
author

Stefan Seehafer sea75300@yahoo.de

copyright

(c) 2020, Stefan Seehafer

license

http://www.gnu.org/licenses/gpl.txt GPLv3

since
4.4

Table of Contents

FILTER_BASE64DECODE  = 12
HTTP Filter base64_decode
FILTER_CASTINT  = 9
HTTP Filter intval
FILTER_DECRYPT  = 10
HTTP Filter crypt::decrypt
FILTER_FIRSTUPPER  = 13
HTTP Filter ucfirst
FILTER_HTMLENTITIES  = 3
HTTP Filter htmlentities
FILTER_HTMLENTITY_DECODE  = 6
HTTP Filter html_entity_decode
FILTER_HTMLSPECIALCHARS  = 2
HTTP Filter htmlspecialchars
FILTER_HTMLSPECIALCHARS_DECODE  = 5
HTTP Filter htmlspecialchars_decode
FILTER_JSON_DECODE  = 8
HTTP Filter json_decode
FILTER_REGEX  = 14
Regex filter
FILTER_REGEX_REPLACE  = 15
Regex replace filter
FILTER_SANITIZE  = 16
filter_var sanitize filter
FILTER_STRIPSLASHES  = 4
HTTP Filter stripslashes
FILTER_STRIPTAGS  = 1
HTTP Filter strip_tags
FILTER_TRIM  = 7
HTTP Filter trim
FILTER_URLDECODE  = 11
HTTP Filter urldecode
PARAM_HTML_MODE  = 'mode'
strip_tag allowed tags param
PARAM_JSON_ASOBJECT  = 'object'
json_decode as object param
PARAM_REGEX  = 'regex'
Regex expression param
PARAM_REGEX_REPLACE  = 'regexReplace'
Regex replace filter param
PARAM_SANITIZE  = 'filter'
filter_var sanitize filter param
PARAM_STRIPTAGS_ALLOWED  = 'allowedtags'
strip_tag allowed tags param
filter()  : mixed
Filter request values
fromCookie()  : mixed
Fetch data from cookies request
fromFiles()  : null|array<string|int, mixed>
Fetch data from uploaded files HTML form request
fromGET()  : mixed
Fetch data from GET request
fromPOST()  : mixed
Fetch data from POST request
getHost()  : string
Returns HTTP Host string
getID()  : int
Fetch ID from GET-request
getIDs()  : array<string|int, mixed>
Fetch multiple ids from POST-request
getIntMode()  : int
Fetch mode as integer value from GET-request
getIp()  : string
Return remote address (ip address)
getModule()  : int
Fetch module string from GET-request
getPage()  : int
Fetch current pagefrom request
getPOSTItems()  : array<string|int, mixed>
Returns item keys for POST request
hasMessage()  : bool
Check if get parameter contains message indicator
assignFilter1()  : bool
strip_tags filter
assignFilter10()  : bool
Descrypt filter
assignFilter11()  : bool
urldecode filter
assignFilter12()  : bool
base64_decode filter
assignFilter13()  : bool
ucfirst filter
assignFilter14()  : bool
ucfirst filter
assignFilter15()  : bool
ucfirst filter
assignFilter16()  : bool
Sanitize filter
assignFilter4()  : bool
stripslashes filter
assignFilter7()  : bool
trim filter
assignFilter8()  : bool
json_decode filter
assignFilter9()  : bool
int cast filter
assignFilterCommon()  : bool
Common filter

Constants

FILTER_BASE64DECODE

HTTP Filter base64_decode

public mixed FILTER_BASE64DECODE = 12

FILTER_CASTINT

HTTP Filter intval

public mixed FILTER_CASTINT = 9

FILTER_DECRYPT

HTTP Filter crypt::decrypt

public mixed FILTER_DECRYPT = 10

FILTER_FIRSTUPPER

HTTP Filter ucfirst

public mixed FILTER_FIRSTUPPER = 13

FILTER_HTMLENTITIES

HTTP Filter htmlentities

public mixed FILTER_HTMLENTITIES = 3

FILTER_HTMLENTITY_DECODE

HTTP Filter html_entity_decode

public mixed FILTER_HTMLENTITY_DECODE = 6

FILTER_HTMLSPECIALCHARS

HTTP Filter htmlspecialchars

public mixed FILTER_HTMLSPECIALCHARS = 2

FILTER_HTMLSPECIALCHARS_DECODE

HTTP Filter htmlspecialchars_decode

public mixed FILTER_HTMLSPECIALCHARS_DECODE = 5

FILTER_JSON_DECODE

HTTP Filter json_decode

public mixed FILTER_JSON_DECODE = 8

FILTER_REGEX

Regex filter

public mixed FILTER_REGEX = 14

FILTER_REGEX_REPLACE

Regex replace filter

public mixed FILTER_REGEX_REPLACE = 15

FILTER_SANITIZE

filter_var sanitize filter

public mixed FILTER_SANITIZE = 16

FILTER_STRIPSLASHES

HTTP Filter stripslashes

public mixed FILTER_STRIPSLASHES = 4

FILTER_STRIPTAGS

HTTP Filter strip_tags

public mixed FILTER_STRIPTAGS = 1

FILTER_TRIM

HTTP Filter trim

public mixed FILTER_TRIM = 7

FILTER_URLDECODE

HTTP Filter urldecode

public mixed FILTER_URLDECODE = 11

PARAM_HTML_MODE

strip_tag allowed tags param

public mixed PARAM_HTML_MODE = 'mode'

PARAM_JSON_ASOBJECT

json_decode as object param

public mixed PARAM_JSON_ASOBJECT = 'object'

PARAM_REGEX

Regex expression param

public mixed PARAM_REGEX = 'regex'

PARAM_REGEX_REPLACE

Regex replace filter param

public mixed PARAM_REGEX_REPLACE = 'regexReplace'

PARAM_SANITIZE

filter_var sanitize filter param

public mixed PARAM_SANITIZE = 'filter'

PARAM_STRIPTAGS_ALLOWED

strip_tag allowed tags param

public mixed PARAM_STRIPTAGS_ALLOWED = 'allowedtags'

Methods

filter()

Filter request values

public filter(type $values[, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
$values : type
$filters : array<string|int, mixed> = []

(@see FILTER_* constants)

allowedtags: allowed HTML tags for strip_tags
mode: @see ENT_* constants of PHP
object: return "json_decode" result as object or array
regex: regex expression for preg_match/preg_filter
regexReplace: filter expression for preg_filter

Return values
mixed

fromCookie()

Fetch data from cookies request

public fromCookie(string $var[, array<string|int, mixed> $filters = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM] ]) : mixed
Parameters
$var : string
$filters : array<string|int, mixed> = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM]
Return values
mixed

fromFiles()

Fetch data from uploaded files HTML form request

public fromFiles([string $var = 'files' ]) : null|array<string|int, mixed>
Parameters
$var : string = 'files'
Return values
null|array<string|int, mixed>

fromGET()

Fetch data from GET request

public fromGET(string $var[, array<string|int, mixed> $filters = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM] ]) : mixed
Parameters
$var : string
$filters : array<string|int, mixed> = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM]
Return values
mixed

fromPOST()

Fetch data from POST request

public fromPOST(string $var[, array<string|int, mixed> $filters = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM] ]) : mixed
Parameters
$var : string
$filters : array<string|int, mixed> = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM]
Return values
mixed

getHost()

Returns HTTP Host string

public getHost() : string
Return values
string

getID()

Fetch ID from GET-request

public getID() : int
Return values
int

getIDs()

Fetch multiple ids from POST-request

public getIDs() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIntMode()

Fetch mode as integer value from GET-request

public getIntMode() : int
Return values
int

getIp()

Return remote address (ip address)

public getIp() : string
Return values
string

getModule()

Fetch module string from GET-request

public getModule() : int
Return values
int

getPage()

Fetch current pagefrom request

public getPage() : int
Return values
int

getPOSTItems()

Returns item keys for POST request

public getPOSTItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasMessage()

Check if get parameter contains message indicator

public hasMessage(string $msg) : bool
Parameters
$msg : string
Return values
bool

assignFilter1()

strip_tags filter

private assignFilter1(mixed &$value, array<string|int, mixed> $filters) : bool
Parameters
$value : mixed
$filters : array<string|int, mixed>
Return values
bool

assignFilter10()

Descrypt filter

private assignFilter10(mixed &$value) : bool
Parameters
$value : mixed
Tags
see
crypt::decrypt
Return values
bool

assignFilter11()

urldecode filter

private assignFilter11(mixed &$value) : bool
Parameters
$value : mixed
Return values
bool

assignFilter12()

base64_decode filter

private assignFilter12(mixed &$value) : bool
Parameters
$value : mixed
Return values
bool

assignFilter13()

ucfirst filter

private assignFilter13(mixed &$value) : bool
Parameters
$value : mixed
Return values
bool

assignFilter14()

ucfirst filter

private assignFilter14(mixed &$value, array<string|int, mixed> $filters) : bool
Parameters
$value : mixed
$filters : array<string|int, mixed>
Return values
bool

assignFilter15()

ucfirst filter

private assignFilter15(mixed &$value, array<string|int, mixed> $filters) : bool
Parameters
$value : mixed
$filters : array<string|int, mixed>
Return values
bool

assignFilter16()

Sanitize filter

private assignFilter16(mixed &$value, array<string|int, mixed> $filters) : bool
Parameters
$value : mixed
$filters : array<string|int, mixed>
Return values
bool

assignFilter4()

stripslashes filter

private assignFilter4(mixed &$value) : bool
Parameters
$value : mixed
Return values
bool

assignFilter7()

trim filter

private assignFilter7(mixed &$value) : bool
Parameters
$value : mixed
Return values
bool

assignFilter8()

json_decode filter

private assignFilter8(mixed &$value, array<string|int, mixed> $filters) : bool
Parameters
$value : mixed
$filters : array<string|int, mixed>
Return values
bool

assignFilter9()

int cast filter

private assignFilter9(mixed &$value) : bool
Parameters
$value : mixed
Return values
bool

assignFilterCommon()

Common filter

private assignFilterCommon(mixed &$value, string $function, array<string|int, mixed> $filters) : bool
Parameters
$value : mixed
$function : string
$filters : array<string|int, mixed>
Return values
bool

Search results