PHP Class SimpleRoute, simpletest

Released under GPLv3 license; see LICENSE.
Inheritance: extends BaseRoute
Afficher le fichier Open project: simpletest/simpletest Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( SimpleUrl $url ) Sets the target URL.
createConnection ( string $method, integer $timeout ) : SimpleSocket Opens a socket to the route.
getUrl ( ) : SimpleUrl Resource name.

Méthodes protégées

Méthode Description
createSocket ( string $scheme, string $host, integer $port, integer $timeout ) : SimpleSocket/SimpleSecureSocket Factory for socket.
getHostLine ( ) : string Creates the host part of the request.
getRequestLine ( string $method ) : string Creates the first line which is the actual request.

Method Details

__construct() public méthode

Sets the target URL.
public __construct ( SimpleUrl $url )
$url SimpleUrl URL as object.

createConnection() public méthode

Opens a socket to the route.
public createConnection ( string $method, integer $timeout ) : SimpleSocket
$method string HTTP request method, usually GET.
$timeout integer Connection timeout.
Résultat SimpleSocket New socket.

createSocket() protected méthode

Factory for socket.
protected createSocket ( string $scheme, string $host, integer $port, integer $timeout ) : SimpleSocket/SimpleSecureSocket
$scheme string Protocol to use.
$host string Hostname to connect to.
$port integer Remote port.
$timeout integer Connection timeout.
Résultat SimpleSocket/SimpleSecureSocket

getHostLine() protected méthode

Creates the host part of the request.
protected getHostLine ( ) : string
Résultat string Host line content.

getRequestLine() protected méthode

Creates the first line which is the actual request.
protected getRequestLine ( string $method ) : string
$method string HTTP request method, usually GET.
Résultat string Request line content.

getUrl() public méthode

Resource name.
public getUrl ( ) : SimpleUrl
Résultat SimpleUrl Current url.