PHP Класс SimpleRoute, simpletest

Released under GPLv3 license; see LICENSE.
Наследование: extends BaseRoute
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( SimpleUrl $url ) Sets the target URL.
createConnection ( string $method, integer $timeout ) : SimpleSocket Opens a socket to the route.
getUrl ( ) : SimpleUrl Resource name.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

createConnection() публичный Метод

Opens a socket to the route.
public createConnection ( string $method, integer $timeout ) : SimpleSocket
$method string HTTP request method, usually GET.
$timeout integer Connection timeout.
Результат SimpleSocket New socket.

createSocket() защищенный Метод

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.
Результат SimpleSocket/SimpleSecureSocket

getHostLine() защищенный Метод

Creates the host part of the request.
protected getHostLine ( ) : string
Результат string Host line content.

getRequestLine() защищенный Метод

Creates the first line which is the actual request.
protected getRequestLine ( string $method ) : string
$method string HTTP request method, usually GET.
Результат string Request line content.

getUrl() публичный Метод

Resource name.
public getUrl ( ) : SimpleUrl
Результат SimpleUrl Current url.