Properties

$methods

$methods : array

The supported HTTP methods

Type

array

Methods

input()

input(string  $recv_buffer, \Workerman\Connection\TcpConnection  $connection) : integer

Check the integrity of the package.

Parameters

string $recv_buffer
\Workerman\Connection\TcpConnection $connection

Returns

integer

decode()

decode(string  $recv_buffer, \Workerman\Connection\TcpConnection  $connection) : array

Parse $_POST、$_GET、$_COOKIE.

Parameters

string $recv_buffer
\Workerman\Connection\TcpConnection $connection

Returns

array

encode()

encode(string  $content, \Workerman\Connection\TcpConnection  $connection) : string

Http encode.

Parameters

string $content
\Workerman\Connection\TcpConnection $connection

Returns

string

header()

header(  $content,   $replace = true,   $http_response_code) : boolean|void

设置http头

Parameters

$content
$replace
$http_response_code

Returns

boolean|void

headerRemove()

headerRemove(string  $name) : void

Remove header.

Parameters

string $name

setcookie()

setcookie(string  $name, string  $value = '', integer  $maxage, string  $path = '', string  $domain = '', boolean  $secure = false, boolean  $HTTPOnly = false) : boolean|void

Set cookie.

Parameters

string $name
string $value
integer $maxage
string $path
string $domain
boolean $secure
boolean $HTTPOnly

Returns

boolean|void

sessionCreateId()

sessionCreateId() : string

sessionCreateId

Returns

string

sessionId()

sessionId(string  $id = null) : string|null

sessionId

Parameters

string $id

Returns

string|null

sessionName()

sessionName(string  $name = null) : string

sessionName

Parameters

string $name

Returns

string

sessionSavePath()

sessionSavePath(string  $path = null) : void

sessionSavePath

Parameters

string $path

sessionStarted()

sessionStarted() : boolean

sessionStarted

Returns

boolean

sessionStart()

sessionStart() : boolean

sessionStart

Returns

boolean

sessionWriteClose()

sessionWriteClose() : boolean

Save session.

Returns

boolean

end()

end(string  $msg = '') 

End, like call exit in php-fpm.

Parameters

string $msg

Throws

\Exception

getMimeTypesFile()

getMimeTypesFile() : string

Get mime types.

Returns

string

tryGcSessions()

tryGcSessions() : void

Try GC sessions.

getRequestSize()

getRequestSize(string  $header, string  $method) : integer

Get whole size of the request includes the request headers and request body.

Parameters

string $header

The request headers

string $method

The request method

Returns

integer

parseUploadFiles()

parseUploadFiles(string  $http_body, string  $http_post_boundary) : void

Parse $_FILES.

Parameters

string $http_body
string $http_post_boundary