PHP Class Workerman\Protocols\Http

Datei anzeigen Open project: walkor/workerman Class Usage Examples

Public Methods

Method Description
decode ( string $recv_buffer, TcpConnection $connection ) : array Parse $_POST、$_GET、$_COOKIE.
encode ( string $content, TcpConnection $connection ) : string Http encode.
end ( string $msg = '' ) End, like call exit in php-fpm.
getMimeTypesFile ( ) : string Get mime types.
header ( $content, $replace = true, $http_response_code ) : boolean | void 设置http头
headerRemove ( string $name ) : void Remove header.
input ( string $recv_buffer, TcpConnection $connection ) : integer Check the integrity of the package.
sessionStart ( ) : boolean sessionStart
sessionWriteClose ( ) : boolean Save session.
setcookie ( string $name, string $value = '', integer $maxage, string $path = '', string $domain = '', boolean $secure = false, boolean $HTTPOnly = false ) : boolean | void Set cookie.
tryGcSessions ( ) : void Try GC sessions.

Protected Methods

Method Description
parseUploadFiles ( string $http_body, string $http_post_boundary ) : void Parse $_FILES.

Method Details

decode() public static method

Parse $_POST、$_GET、$_COOKIE.
public static decode ( string $recv_buffer, TcpConnection $connection ) : array
$recv_buffer string
$connection Workerman\Connection\TcpConnection
return array

encode() public static method

Http encode.
public static encode ( string $content, TcpConnection $connection ) : string
$content string
$connection Workerman\Connection\TcpConnection
return string

end() public static method

End, like call exit in php-fpm.
public static end ( string $msg = '' )
$msg string

getMimeTypesFile() public static method

Get mime types.
public static getMimeTypesFile ( ) : string
return string

header() public static method

设置http头
public static header ( $content, $replace = true, $http_response_code ) : boolean | void
return boolean | void

headerRemove() public static method

Remove header.
public static headerRemove ( string $name ) : void
$name string
return void

input() public static method

Check the integrity of the package.
public static input ( string $recv_buffer, TcpConnection $connection ) : integer
$recv_buffer string
$connection Workerman\Connection\TcpConnection
return integer

parseUploadFiles() protected static method

Parse $_FILES.
protected static parseUploadFiles ( string $http_body, string $http_post_boundary ) : void
$http_body string
$http_post_boundary string
return void

sessionStart() public static method

sessionStart
public static sessionStart ( ) : boolean
return boolean

sessionWriteClose() public static method

Save session.
public static sessionWriteClose ( ) : boolean
return boolean

setcookie() public static method

Set cookie.
public static setcookie ( string $name, string $value = '', integer $maxage, string $path = '', string $domain = '', boolean $secure = false, boolean $HTTPOnly = false ) : boolean | void
$name string
$value string
$maxage integer
$path string
$domain string
$secure boolean
$HTTPOnly boolean
return boolean | void

tryGcSessions() public static method

Try GC sessions.
public static tryGcSessions ( ) : void
return void