PHP 클래스 PHPDaemon\HTTPRequest\Generic

저자: Vasily Zorin ([email protected])
상속: extends PHPDaemon\Request\Generic, use trait PHPDaemon\Traits\DeferredEventHandlers, use trait PHPDaemon\Traits\Sessions
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$htr State
$hvaltr Replacement pairs for processing some header values in parse_str()
$keepalive Keepalive?
$responseLength Current response length

보호된 프로퍼티들

프로퍼티 타입 설명
$codes Status codes
$contentLength Content length from header() method
$contype Content type parameters
$cookieNum Number of outgoing cookie-headers
$frozenInput Frozen input?
$headers Outgoing headers
$headers_sent Headers sent?
$headers_sent_file File name where output started in the file and line variables
$headers_sent_line Line number where output started in the file and line variables
$sendfp File pointer to send output (X-Sendfile)

공개 메소드들

메소드 설명
checkIfReady ( ) : boolean Called to check if Request is ready
chunked ( ) : void Use chunked encoding
combinedOut ( string $s ) : boolean Outputs data with headers (split by \r\n\r\n)
ensureSentHeaders ( ) : boolean Ensure that headers are sent
firstDeferredEventUsed ( ) : void Called when first deferred event used
getUploadMaxSize ( ) : integer Upload maximum file size
getUploadTempDir ( ) : string Returns path to directory of temporary upload files
header ( string $s, boolean $replace = true, integer $code = false ) : boolean Send the header
headersList ( ) : array Return current list of headers
headersSent ( &$file, &$line ) : boolean Checks if headers have been sent
isUploadedFile ( string $path ) : boolean Tells whether the file was uploaded via HTTP POST
moveUploadedFile ( string $filename, string $dest ) : boolean Moves an uploaded file to a new location
onParsedParams ( ) : void Called when request's headers parsed
onSleep ( ) : void Called when the request starts sleep
onUploadFileChunk ( Input $in, boolean $last = false ) : void Called when chunk of incoming file has arrived
onUploadFileStart ( Input $in ) : void Called when file upload started
onWakeup ( ) : void Called when the request wakes up
out ( string $s, boolean $flush = true ) : boolean Output some data
parseSize ( string $value ) : integer Converts human-readable representation of size to number of bytes
parseStr ( string $s, &$var, boolean $header = false ) : void Replacement for default parse_str(), it supoorts UCS-2 like this: %uXXXX
postPrepare ( ) : void Prepares the request body
readBodyFile ( ) : boolean Read request body from the file given in REQUEST_BODY_FILE parameter
removeHeader ( string $s ) : void Removes a header
sendfile ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : boolean Output whole contents of file
setcookie ( string $name, string $value = '', integer $maxage, string $path = '', string $domain = '', boolean $secure = false, boolean $HTTPOnly = false ) : void Set the cookie
status ( integer $code = 200 ) : boolean Send HTTP-status

보호된 메소드들

메소드 설명
freezeInput ( ) : void Freeze input
getCookieStr ( string $name ) : string Get cookie by name
parseParams ( ) : void Parses GET-query string and other request's headers
postFinishHandler ( callable $cb = null ) : void Called after request finish
preinit ( object $req ) : void Preparing before init
unfreezeInput ( ) : void Unfreeze input

메소드 상세

checkIfReady() 공개 메소드

Called to check if Request is ready
public checkIfReady ( ) : boolean
리턴 boolean Ready?

chunked() 공개 메소드

Use chunked encoding
public chunked ( ) : void
리턴 void

combinedOut() 공개 메소드

Outputs data with headers (split by \r\n\r\n)
public combinedOut ( string $s ) : boolean
$s string Data
리턴 boolean Success

ensureSentHeaders() 공개 메소드

Ensure that headers are sent
public ensureSentHeaders ( ) : boolean
리턴 boolean Were already sent?

firstDeferredEventUsed() 공개 메소드

Called when first deferred event used
public firstDeferredEventUsed ( ) : void
리턴 void

freezeInput() 보호된 메소드

Freeze input
protected freezeInput ( ) : void
리턴 void

getCookieStr() 보호된 메소드

Get cookie by name
protected getCookieStr ( string $name ) : string
$name string Name of cookie
리턴 string Contents

getUploadMaxSize() 공개 메소드

Upload maximum file size
public getUploadMaxSize ( ) : integer
리턴 integer

getUploadTempDir() 공개 메소드

Returns path to directory of temporary upload files
public getUploadTempDir ( ) : string
리턴 string

header() 공개 메소드

Send the header
public header ( string $s, boolean $replace = true, integer $code = false ) : boolean
$s string Header. Example: 'Location: http://php.net/'
$replace boolean Optional. Replace?
$code integer Optional. HTTP response code
리턴 boolean Success

headersList() 공개 메소드

Return current list of headers
public headersList ( ) : array
리턴 array Headers

headersSent() 공개 메소드

Checks if headers have been sent
public headersSent ( &$file, &$line ) : boolean
리턴 boolean Success

isUploadedFile() 공개 메소드

Tells whether the file was uploaded via HTTP POST
public isUploadedFile ( string $path ) : boolean
$path string The filename being checked
리턴 boolean Whether if this is uploaded file

moveUploadedFile() 공개 메소드

Moves an uploaded file to a new location
public moveUploadedFile ( string $filename, string $dest ) : boolean
$filename string The filename of the uploaded file
$dest string The destination of the moved file
리턴 boolean Success

onParsedParams() 공개 메소드

Called when request's headers parsed
public onParsedParams ( ) : void
리턴 void

onSleep() 공개 메소드

Called when the request starts sleep
public onSleep ( ) : void
리턴 void

onUploadFileChunk() 공개 메소드

Called when chunk of incoming file has arrived
public onUploadFileChunk ( Input $in, boolean $last = false ) : void
$in Input Input buffer
$last boolean Last?
리턴 void

onUploadFileStart() 공개 메소드

Called when file upload started
public onUploadFileStart ( Input $in ) : void
$in Input Input buffer
리턴 void

onWakeup() 공개 메소드

Called when the request wakes up
public onWakeup ( ) : void
리턴 void

out() 공개 메소드

Output some data
public out ( string $s, boolean $flush = true ) : boolean
$s string String to out
$flush boolean ob_flush?
리턴 boolean Success

parseParams() 보호된 메소드

Parses GET-query string and other request's headers
protected parseParams ( ) : void
리턴 void

parseSize() 공개 정적인 메소드

Converts human-readable representation of size to number of bytes
public static parseSize ( string $value ) : integer
$value string String of size
리턴 integer

parseStr() 공개 정적인 메소드

Replacement for default parse_str(), it supoorts UCS-2 like this: %uXXXX
public static parseStr ( string $s, &$var, boolean $header = false ) : void
$s string String to parse
$header boolean Header-style string
리턴 void

postFinishHandler() 보호된 메소드

Called after request finish
protected postFinishHandler ( callable $cb = null ) : void
$cb callable Callback
리턴 void

postPrepare() 공개 메소드

Prepares the request body
public postPrepare ( ) : void
리턴 void

preinit() 보호된 메소드

Preparing before init
protected preinit ( object $req ) : void
$req object Source request
리턴 void

readBodyFile() 공개 메소드

Read request body from the file given in REQUEST_BODY_FILE parameter
public readBodyFile ( ) : boolean
리턴 boolean Success

removeHeader() 공개 메소드

Removes a header
public removeHeader ( string $s ) : void
$s string Header name. Example: 'Location'
리턴 void

sendfile() 공개 메소드

Output whole contents of file
public sendfile ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : boolean
$path string Path
$cb callable Callback
$pri integer Priority
리턴 boolean Success

setcookie() 공개 메소드

Set the cookie
public setcookie ( string $name, string $value = '', integer $maxage, string $path = '', string $domain = '', boolean $secure = false, boolean $HTTPOnly = false ) : void
$name string Name of cookie
$value string Value
$maxage integer Optional. Max-Age. Default is 0
$path string Optional. Path. Default is empty string
$domain string Optional. Domain. Default is empty string
$secure boolean Optional. Secure. Default is false
$HTTPOnly boolean Optional. HTTPOnly. Default is false
리턴 void

status() 공개 메소드

Send HTTP-status
public status ( integer $code = 200 ) : boolean
$code integer Code
리턴 boolean Success

unfreezeInput() 보호된 메소드

Unfreeze input
protected unfreezeInput ( ) : void
리턴 void

프로퍼티 상세

$codes 보호되어 있는 정적으로 프로퍼티

Status codes
protected static $codes

$contentLength 보호되어 있는 프로퍼티

Content length from header() method
protected $contentLength

$contype 보호되어 있는 프로퍼티

Content type parameters
protected $contype

$cookieNum 보호되어 있는 프로퍼티

Number of outgoing cookie-headers
protected $cookieNum

$frozenInput 보호되어 있는 프로퍼티

Frozen input?
protected $frozenInput

$headers 보호되어 있는 프로퍼티

Outgoing headers
protected $headers

$headers_sent 보호되어 있는 프로퍼티

Headers sent?
protected $headers_sent

$headers_sent_file 보호되어 있는 프로퍼티

File name where output started in the file and line variables
protected $headers_sent_file

$headers_sent_line 보호되어 있는 프로퍼티

Line number where output started in the file and line variables
protected $headers_sent_line

$htr 공개적으로 정적으로 프로퍼티

State
public static $htr

$hvaltr 공개적으로 정적으로 프로퍼티

Replacement pairs for processing some header values in parse_str()
public static $hvaltr

$keepalive 공개적으로 프로퍼티

Keepalive?
public $keepalive

$responseLength 공개적으로 프로퍼티

Current response length
public $responseLength

$sendfp 보호되어 있는 프로퍼티

File pointer to send output (X-Sendfile)
protected $sendfp