Srv
Read-only access to server and environment values: host, scheme, ip, headers.
Request 8
- method The request method, such as `GET`.
- scheme The request scheme, such as `https`.
- host The requested host name.
- uri The request URI, with its query string.
- ssl Whether the request came over HTTPS.
- ip The client IP address, or null.
- userAgent The User-Agent header, or null.
- referrer The Referer header, or null.
Server 8
- get Returns a raw $_SERVER value by key.
- sapi The PHP SAPI name, such as `fpm-fcgi` or `cli`.
- phpVersion The running PHP version.
- hostname The server's host name, or null.
- port The server port.
- protocol The HTTP protocol, such as `HTTP/1.1`.
- software The web server software, or null.
- caller The file that called the function calling this one.
Request
Srv::method(): string
The request method, such as `GET`.
Returns string
phlat/src/Toolkit/Srv.php:17
Srv::scheme(): string
The request scheme, such as `https`.
Returns string
phlat/src/Toolkit/Srv.php:23
Srv::uri(): string
The request URI, with its query string.
Returns string
phlat/src/Toolkit/Srv.php:35
Srv::userAgent(): ?string
The User-Agent header, or null.
Returns ?string
phlat/src/Toolkit/Srv.php:53
Srv::referrer(): ?string
The Referer header, or null.
Returns ?string
phlat/src/Toolkit/Srv.php:59
Headers
Srv::header(string $name, ?string $default = null): ?string
Returns an HTTP request header by name, normalising it to the HTTP_* $_SERVER key format.
Parameters (2)
| $name | string | |
| $default | ?string = null |
Returns ?string
phlat/src/Toolkit/Srv.php:67
Server
Srv::get(string $key, ?string $default = null): ?string
Returns a raw $_SERVER value by key.
Parameters (2)
| $key | string | |
| $default | ?string = null |
Returns ?string
phlat/src/Toolkit/Srv.php:76
Srv::sapi(): string
The PHP SAPI name, such as `fpm-fcgi` or `cli`.
Returns string
phlat/src/Toolkit/Srv.php:82
Srv::phpVersion(): string
The running PHP version.
Returns string
phlat/src/Toolkit/Srv.php:88
Srv::hostname(): ?string
The server's host name, or null.
Returns ?string
phlat/src/Toolkit/Srv.php:94
Srv::protocol(): string
The HTTP protocol, such as `HTTP/1.1`.
Returns string
phlat/src/Toolkit/Srv.php:106
Srv::software(): ?string
The web server software, or null.
Returns ?string
phlat/src/Toolkit/Srv.php:112
Srv::caller(): string
The file that called the function calling this one.
Returns string
phlat/src/Toolkit/Srv.php:118