PHP Class Webiny\Component\Http\Request\Server

This class provide OO methods for accessing $_SERVER properties.
Inheritance: use trait Webiny\Component\StdLib\StdLibTrait
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ) Constructor
authType ( ) : string
documentRoot ( ) : string
gatewayInterface ( ) : string
get ( string $key ) : string
getAll ( )
httpAccept ( ) : string
httpAcceptCharset ( ) : string
httpAcceptEncoding ( ) : string
httpAcceptLanguage ( ) : string
httpClientIp ( ) : string
httpConnection ( ) : string
httpHost ( ) : string
httpReferer ( ) : string
httpUserAgent ( ) : string
httpXForwardedFor ( ) : string
https ( ) : string
origPathInfo ( ) : string
pathInfo ( ) : string
pathTranslated ( ) : string
phpAuthDigest ( ) : string
phpAuthPw ( ) : string
phpAuthUser ( ) : string
queryString ( ) : string
redirectRemoteUser ( ) : string
remoteAddress ( ) : string
remoteHost ( ) : string
remotePort ( ) : string
requestMethod ( ) : string
requestTime ( boolean $float = false ) : string
requestUri ( ) : string
scriptFilename ( ) : string
scriptName ( ) : string
serverAdmin ( ) : string
serverIpAddress ( ) : string
serverName ( ) : string
serverPort ( ) : string
serverProtocol ( ) : string
serverSignature ( ) : string
serverSoftware ( ) : string

Method Details

__construct() public méthode

Constructor
public __construct ( )

authType() public méthode

public authType ( ) : string
Résultat string When doing HTTP authenticated this variable is set to the authentication type.

documentRoot() public méthode

public documentRoot ( ) : string
Résultat string The document root directory under which the current script is executing, as defined in the server's configuration file.

gatewayInterface() public méthode

public gatewayInterface ( ) : string
Résultat string What revision of the CGI specification the server is using; i.e. 'CGI/1.1'.

get() public méthode

public get ( string $key ) : string
$key string $_SERVER key
Résultat string

getAll() public méthode

public getAll ( )

httpAccept() public méthode

public httpAccept ( ) : string
Résultat string Contents of the Accept: header from the current request, if there is one.

httpAcceptCharset() public méthode

public httpAcceptCharset ( ) : string
Résultat string Contents of the Accept-Charset: header from the current request, if there is one. Example: 'iso-8859-1,*,utf-8'.

httpAcceptEncoding() public méthode

public httpAcceptEncoding ( ) : string
Résultat string Contents of the Accept-Encoding: header from the current request, if there is one. Example: 'gzip'.

httpAcceptLanguage() public méthode

public httpAcceptLanguage ( ) : string
Résultat string Contents of the Accept-Language: header from the current request, if there is one. Example: 'en'.

httpClientIp() public méthode

public httpClientIp ( ) : string
Résultat string Clients' ip address. This date cannot be trusted if you are behind a reverse proxy. In that case you should first check for Server::httpXForwardedFor.

httpConnection() public méthode

public httpConnection ( ) : string
Résultat string Contents of the Connection: header from the current request, if there is one. Example: 'Keep-Alive'.

httpHost() public méthode

public httpHost ( ) : string
Résultat string Contents of the Host: header from the current request, if there is one.

httpReferer() public méthode

public httpReferer ( ) : string
Résultat string The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

httpUserAgent() public méthode

public httpUserAgent ( ) : string
Résultat string Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page's output to the capabilities of the user agent.

httpXForwardedFor() public méthode

public httpXForwardedFor ( ) : string
Résultat string Check for clients ip behind a reverse proxy.

https() public méthode

public https ( ) : string
Résultat string Set to a non-empty value if the script was queried through the HTTPS protocol. NOTE: Note that when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol.

origPathInfo() public méthode

public origPathInfo ( ) : string
Résultat string Original version of 'PATH_INFO' before processed by PHP.

pathInfo() public méthode

public pathInfo ( ) : string
Résultat string Contains any client-provided pathname information trailing the actual script filename but preceding the query string, if available. For instance, if the current script was accessed via the URL http://www.example.com/php/path_info.php/some/stuff?foo=bar, then $_SERVER['PATH_INFO'] would contain /some/stuff.

pathTranslated() public méthode

public pathTranslated ( ) : string
Résultat string Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping.

phpAuthDigest() public méthode

public phpAuthDigest ( ) : string
Résultat string When doing Digest HTTP authentication this variable is set to the 'Authorization' header sent by the client (which you should then use to make the appropriate validation).

phpAuthPw() public méthode

public phpAuthPw ( ) : string
Résultat string When doing HTTP authentication this variable is set to the password provided by the user.

phpAuthUser() public méthode

public phpAuthUser ( ) : string
Résultat string When doing HTTP authentication this variable is set to the username provided by the user.

queryString() public méthode

public queryString ( ) : string
Résultat string The query string, if any, via which the page was accessed.

redirectRemoteUser() public méthode

public redirectRemoteUser ( ) : string
Résultat string The authenticated user if the request is internally redirected.

remoteAddress() public méthode

public remoteAddress ( ) : string
Résultat string The IP address from which the user is viewing the current page.

remoteHost() public méthode

public remoteHost ( ) : string
Résultat string The Host name from which the user is viewing the current page. The reverse dns lookup is based off the REMOTE_ADDR of the user.

remotePort() public méthode

public remotePort ( ) : string
Résultat string The port being used on the user's machine to communicate with the web server.

requestMethod() public méthode

public requestMethod ( ) : string
Résultat string Which request method was used to access the page; i.e. 'GET', 'HEAD', 'POST', 'PUT'. NOTE: PHP script is terminated after sending headers (it means after producing any output without output buffering) if the request method was HEAD.

requestTime() public méthode

public requestTime ( boolean $float = false ) : string
$float boolean Microsecond precision or not.
Résultat string The timestamp of the start of the request.

requestUri() public méthode

public requestUri ( ) : string
Résultat string The URI which was given in order to access this page; for instance, '/index.html'.

scriptFilename() public méthode

public scriptFilename ( ) : string
Résultat string The absolute pathname of the currently executing script. Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php, $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user.

scriptName() public méthode

public scriptName ( ) : string
Résultat string Contains the current script's path. This is useful for pages which need to point to themselves. The __FILE__ constant contains the full path and filename of the current (i.e. included) file.

serverAdmin() public méthode

public serverAdmin ( ) : string
Résultat string The value given to the SERVER_ADMIN (for Apache) directive in the web server configuration file. If the script is running on a virtual host, this will be the value defined for that virtual host.

serverIpAddress() public méthode

public serverIpAddress ( ) : string
Résultat string The IP address of the server under which the current script is executing.

serverName() public méthode

public serverName ( ) : string
Résultat string The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host.

serverPort() public méthode

public serverPort ( ) : string
Résultat string The port on the server machine being used by the web server for communication. For default setups, this will be '80'; using SSL, for instance, will change this to whatever your defined secure HTTP port is. Note: Under the Apache 2, you must set UseCanonicalName = On, as well as UseCanonicalPhysicalPort = On in order to get the physical (real) port, otherwise, this value can be spoofed and it may or may not return the physical port value. It is not safe to rely on this value in security-dependent contexts.

serverProtocol() public méthode

public serverProtocol ( ) : string
Résultat string Name and revision of the information protocol via which the page was requested; i.e. 'HTTP/1.0';

serverSignature() public méthode

public serverSignature ( ) : string
Résultat string String containing the server version and virtual host name which are added to server-generated pages, if enabled.

serverSoftware() public méthode

public serverSoftware ( ) : string
Résultat string Server identification string, given in the headers when responding to requests.