Methods |
public
|
init()
Advance Function, Internal use
Advance Function, Internal use
|
#
|
public
|
getSecurityPolicy(string $extrahost = "", string $extrawshost = ""): array
Generate Security Policy for Browser
Generate Security Policy for Browser
Parameters
$extrahost |
host list
|
$extrawshost |
Web Socket host list
|
|
#
|
public
|
addSecurityHeaders(array $policy = [], string $policyExtra = "", string $reportURL = "")
Add Security Policy into Browser
Add Security Policy into Browser
Parameters
$reportURL |
error reporting url
|
|
#
|
public
|
setContent($data)
Advance Function, Internal use
Advance Function, Internal use
|
#
|
public
|
getContent()
Advance Function, Internal use
Advance Function, Internal use
|
#
|
public
|
setStatusCode(int $code)
Set Status Code of Server
Set Status Code of Server
|
#
|
public
|
getStatusCode(): int
Read Status Code of Server
Read Status Code of Server
|
#
|
public
|
addHttpHeader(string $key, string $val, int $statuscode = 0)
Add HTTP Header and send to browser
SphpBase::sphp_response()->addHttpHeader("Cache-control", "public, max-age=864000,…
Add HTTP Header and send to browser
SphpBase::sphp_response()->addHttpHeader("Cache-control", "public, max-age=864000, must-revalidate");
|
#
|
public
|
removeHttpHeader(string $key)
Remove HTTP Header from Response
SphpBase::sphp_response()->removeHttpHeader("Cache-control")
Remove HTTP Header from Response
SphpBase::sphp_response()->removeHttpHeader("Cache-control")
|
#
|
public
|
getHeader(): array
Get All Response Headers
|
#
|
public
|
sendHeaders()
Advance Function, Internal use
Advance Function, Internal use
|
#
|
public
|
setCookie(
string $name,
string $value = "",
int $expire = -1,
string $path = '/',
string $domain = "",
boolean $secure = false,
boolean $httponly = false,
)
Write Cookie
Parameters
$name |
key
|
$expire |
-1 mean calculate expire time
|
|
#
|
public
|
send($sendheader = true)
Advance Function, Internal use
Advance Function, Internal use
|
#
|