PHP Class PHPDaemon\HTTPRequest\Input

Author: Vasily Zorin ([email protected])
Inheritance: extends EventBuffer, use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
显示文件 Open project: kakserpom/phpdaemon Class Usage Examples

Public Properties

Property Type Description
$curPart Current Part

Protected Properties

Property Type Description
$EOF EOF
$boundary Boundary
$curChunkSize Size of current upload chunk
$curPartDisp Content dispostion of current Part
$frozen Frozen
$maxFileSize Maximum file size from multi-part query
$readed Readed
$req Related Request
$state (self::STATE_*) State of multi-part processor

Public Methods

Method Description
freeze ( boolean $at_front = false ) : void Freeze input
getChunkString ( ) : string Get current upload chunk as string
isEof ( ) : boolean Is EOF?
isFrozen ( ) : boolean Is frozen?
log ( string $msg ) : void Log
look ( integer $n, integer $o ) : string Read from buffer without draining
parseMultipart ( ) : void Parses multipart
readFromBuffer ( EventBuffer $buf ) : integer Moves $n bytes from input buffer to arbitrary buffer
readFromString ( string $chunk, boolean $final = true ) : void Append string to input buffer
sendEOF ( ) : void Send EOF
setBoundary ( string $boundary ) : void Set boundary
setRequest ( Generic $req ) : void Set request
unfreeze ( boolean $at_front = false ) : void Unfreeze input
writeChunkToFd ( mixed $fd, callable $cb = null ) : boolean Write current upload chunk to file descriptor

Protected Methods

Method Description
onEOF ( ) : void onEOF
onRead ( ) : void onRead

Method Details

freeze() public method

Freeze input
public freeze ( boolean $at_front = false ) : void
$at_front boolean At front. Default is true. If the front of a buffer is frozen, operations that drain data from the front of the buffer, or that prepend data to the buffer, will fail until it is unfrozen. If the back a buffer is frozen, operations that append data from the buffer will fail until it is unfrozen
return void

getChunkString() public method

Get current upload chunk as string
public getChunkString ( ) : string
return string Chunk body

isEof() public method

Is EOF?
public isEof ( ) : boolean
return boolean

isFrozen() public method

Is frozen?
public isFrozen ( ) : boolean
return boolean

log() public method

Log
public log ( string $msg ) : void
$msg string Message
return void

look() public method

Read from buffer without draining
public look ( integer $n, integer $o ) : string
$n integer Number of bytes to read
$o integer Offset
return string

onEOF() protected method

onEOF
protected onEOF ( ) : void
return void

onRead() protected method

onRead
protected onRead ( ) : void
return void

parseMultipart() public method

Parses multipart
public parseMultipart ( ) : void
return void

readFromBuffer() public method

Moves $n bytes from input buffer to arbitrary buffer
public readFromBuffer ( EventBuffer $buf ) : integer
$buf EventBuffer Source nuffer
return integer

readFromString() public method

Append string to input buffer
public readFromString ( string $chunk, boolean $final = true ) : void
$chunk string Piece of request input
$final boolean Final call is THIS SEQUENCE of calls (not mandatory final in request)?
return void

sendEOF() public method

Send EOF
public sendEOF ( ) : void
return void

setBoundary() public method

Set boundary
public setBoundary ( string $boundary ) : void
$boundary string Boundary
return void

setRequest() public method

Set request
public setRequest ( Generic $req ) : void
$req Generic Request
return void

unfreeze() public method

Unfreeze input
public unfreeze ( boolean $at_front = false ) : void
$at_front boolean At front. Default is true. If the front of a buffer is frozen, operations that drain data from the front of the buffer, or that prepend data to the buffer, will fail until it is unfrozen. If the back a buffer is frozen, operations that append data from the buffer will fail until it is unfrozen
return void

writeChunkToFd() public method

Write current upload chunk to file descriptor
public writeChunkToFd ( mixed $fd, callable $cb = null ) : boolean
$fd mixed File destriptor
$cb callable Callback
return boolean Success

Property Details

$EOF protected_oe property

EOF
protected $EOF

$boundary protected_oe property

Boundary
protected $boundary

$curChunkSize protected_oe property

Size of current upload chunk
protected $curChunkSize

$curPart public_oe property

Current Part
public $curPart

$curPartDisp protected_oe property

Content dispostion of current Part
protected $curPartDisp

$frozen protected_oe property

Frozen
protected $frozen

$maxFileSize protected_oe property

Maximum file size from multi-part query
protected $maxFileSize

$readed protected_oe property

Readed
protected $readed

$req protected_oe property

Related Request
protected $req

$state protected_oe property

(self::STATE_*) State of multi-part processor
protected $state