Properties

$connection

$connection : \Workerman\Connection\TcpConnection

Connection.

Type

TcpConnection

$session

$session : \Workerman\Protocols\Http\Session

Session instance.

Type

Session

$properties

$properties : array

Properties.

Type

array

$_buffer

$_buffer : string

Http buffer.

Type

string

$_data

$_data : array

Request data.

Type

array

$_headerCache

$_headerCache : array

Header cache.

Type

array

$_getCache

$_getCache : array

Get cache.

Type

array

$_postCache

$_postCache : array

Post cache.

Type

array

$_enableCache

$_enableCache : bool

Enable cache.

Type

bool

Methods

__construct()

__construct(string  $buffer) : mixed

Request constructor.

Parameters

string $buffer

Returns

mixed —

get()

get(string|null  $name = null, mixed|null  $default = null) : mixed|null

$_GET.

Parameters

string|null $name
mixed|null $default

Returns

mixed|null —

post()

post(string|null  $name = null, mixed|null  $default = null) : mixed|null

$_POST.

Parameters

string|null $name
mixed|null $default

Returns

mixed|null —

header()

header(string|null  $name = null, mixed|null  $default = null) : array|string|null

Get header item by name.

Parameters

string|null $name
mixed|null $default

Returns

array|string|null —

cookie()

cookie(string|null  $name = null, mixed|null  $default = null) : array|string|null

Get cookie item by name.

Parameters

string|null $name
mixed|null $default

Returns

array|string|null —

file()

file(string|null  $name = null) : array|null

Get upload files.

Parameters

string|null $name

Returns

array|null —

method()

method() : string

Get method.

Returns

string —

protocolVersion()

protocolVersion() : string

Get http protocol version.

Returns

string —

host()

host(bool  $without_port = false) : string

Get host.

Parameters

bool $without_port

Returns

string —

uri()

uri() : mixed

Get uri.

Returns

mixed —

path()

path() : mixed

Get path.

Returns

mixed —

queryString()

queryString() : mixed

Get query string.

Returns

mixed —

session()

session() : bool|\Workerman\Protocols\Http\Session

Get session.

Returns

bool|\Workerman\Protocols\Http\Session —

sessionId()

sessionId() : bool|mixed

Get session id.

Returns

bool|mixed —

rawHead()

rawHead() : string

Get http raw head.

Returns

string —

rawBody()

rawBody() : string

Get http raw body.

Returns

string —

rawBuffer()

rawBuffer() : string

Get raw buffer.

Returns

string —

enableCache()

enableCache(mixed  $value) : mixed

Enable or disable cache.

Parameters

mixed $value

Returns

mixed —

__set()

__set(string  $name, mixed  $value) : void

Setter.

Parameters

string $name
mixed $value

__get()

__get(string  $name) : mixed|null

Getter.

Parameters

string $name

Returns

mixed|null —

__isset()

__isset(string  $name) : bool

Isset.

Parameters

string $name

Returns

bool —

__unset()

__unset(string  $name) : void

Unset.

Parameters

string $name

__toString()

__toString() : mixed

__toString.

Returns

mixed —

__destruct()

__destruct() : void

__destruct.

parseHeadFirstLine()

parseHeadFirstLine() : void

Parse first line of http header buffer.

parseProtocolVersion()

parseProtocolVersion() : void

Parse protocol version.

parseHeaders()

parseHeaders() : void

Parse headers.

parseGet()

parseGet() : void

Parse head.

parsePost()

parsePost() : void

Parse post.

parseUploadFiles()

parseUploadFiles(string  $http_post_boundary) : void

Parse upload files.

Parameters

string $http_post_boundary

createSessionId()

createSessionId() : string

Create session id.

Returns

string —