PHP 클래스 Aerys\Host

파일 보기 프로젝트 열기: amphp/aerys 1 사용 예제들

공개 메소드들

메소드 설명
__clone ( )
__construct ( )
encrypt ( string $certificate, string $key = null, array $options = [] ) : Host Define TLS encryption settings for this host
export ( ) : array Retrieve an associative array summarizing the host definition
expose ( string $address, integer $port ) : Host Assign the IP and port on which to listen
getDefinitions ( ) : array Used by the server bootstrapper to access host configs created by the application
name ( string $name ) : Host Assign a domain name (e.g. localhost or mysite.com or subdomain.mysite.com)
redirect ( string $absoluteUri, integer $redirectCode = 307 ) : Host Redirect all requests that aren't serviced by an action callable
separateIPv4Binding ( ) : boolean
use ( callable | aerys\Middleware | aerys\Bootable | aerys\Monitor $action ) : Host Use a callable request action or Middleware

메소드 상세

__clone() 공개 메소드

public __clone ( )

__construct() 공개 메소드

public __construct ( )

encrypt() 공개 메소드

Define TLS encryption settings for this host
public encrypt ( string $certificate, string $key = null, array $options = [] ) : Host
$certificate string A string path pointing to your SSL/TLS certificate
$key string A string path pointing to your SSL/TLS key file (null if the certificate file is containing the key already)
$options array An optional array mapping additional SSL/TLS settings
리턴 Host

export() 공개 메소드

Retrieve an associative array summarizing the host definition
public export ( ) : array
리턴 array

expose() 공개 메소드

The address may be any valid IPv4 or IPv6 address. The "0.0.0.0" indicates "all IPv4 interfaces" and is appropriate for most users. Use "::" to indicate "all IPv6 interfaces". To indicate "all IPv4 *and* IPv6 interfaces", use a "*" wildcard character. Note that "::" may also listen on some systems on IPv4 interfaces. PHP currently does not expose the IPV6_V6ONLY constant. Any valid port number [1-65535] may be used. Port numbers lower than 256 are reserved for well-known services (like HTTP on port 80) and port numbers less than 1024 require root access on UNIX-like systems. The default port for encrypted sockets (https) is 443. If you plan to use encryption with this host you'll generally want to use port 443.
public expose ( string $address, integer $port ) : Host
$address string The IPv4 or IPv6 interface to listen to
$port integer The port number on which to listen
리턴 Host

getDefinitions() 공개 정적인 메소드

Used by the server bootstrapper to access host configs created by the application
public static getDefinitions ( ) : array
리턴 array

name() 공개 메소드

A host name is only required if a server exposes more than one host. If a name is not defined the server will default to "localhost"
public name ( string $name ) : Host
$name string
리턴 Host

redirect() 공개 메소드

NOTE: the redirect URI must match the format "scheme://hostname.tld" (with optional port and path). The following example redirects all unencrypted requests to the equivalent encrypted resource: setName("mysite.com"); $host->redirect("https://mysite.com");
public redirect ( string $absoluteUri, integer $redirectCode = 307 ) : Host
$absoluteUri string The location to which we wish to redirect
$redirectCode integer The HTTP redirect status code (300-399)
리턴 Host

separateIPv4Binding() 공개 정적인 메소드

public static separateIPv4Binding ( ) : boolean
리턴 boolean

use() 공개 메소드

Host actions are invoked to service requests in the order in which they are added.
public use ( callable | aerys\Middleware | aerys\Bootable | aerys\Monitor $action ) : Host
$action callable | aerys\Middleware | aerys\Bootable | aerys\Monitor
리턴 Host