This is automatic generated document for things in Swow\Http\Parser class
Class Parser
Constants
public EVENTS_ALL = 536870430 public EVENTS_NONE = 0 public EVENT_BODY = 524292 public EVENT_CHUNK_COMPLETE = 4194312 public EVENT_CHUNK_HEADER = 2097152 public EVENT_FLAG_DATA = 4 public EVENT_FLAG_LINE = 2 public EVENT_FLAG_NONE = 0 public EVENT_HEADERS_COMPLETE = 262152 public EVENT_HEADER_FIELD = 16388 public EVENT_HEADER_FIELD_COMPLETE = 65544 public EVENT_HEADER_VALUE = 32772 public EVENT_HEADER_VALUE_COMPLETE = 131080 public EVENT_MESSAGE_BEGIN = 512 public EVENT_MESSAGE_COMPLETE = 1048584 public EVENT_MULTIPART_BODY = 134217748 public EVENT_MULTIPART_DATA_BEGIN = 8388624 public EVENT_MULTIPART_DATA_END = 268435480 public EVENT_MULTIPART_HEADERS_COMPLETE = 67108888 public EVENT_MULTIPART_HEADER_FIELD = 16777236 public EVENT_MULTIPART_HEADER_VALUE = 33554452 public EVENT_NONE = 0 public EVENT_STATUS = 4102 public EVENT_STATUS_COMPLETE = 8200 public EVENT_URL = 1030 public EVENT_URL_COMPLETE = 2056 public TYPE_BOTH = 0 public TYPE_REQUEST = 1 public TYPE_RESPONSE = 2 Methods
Static method getEventNameFor
public static function getEventNameFor ( int $event ) : string Method execute
public function execute ( \Stringable|string $data , int $start , int $length ) : int Parse data until the next event.
Each call stops at one event. A begin or complete event consumes 0 bytes. Call the method again with a larger start to continue.
Returns int bytes consumed by this call
Throws ParserException when the parse fails
Method finish
public function finish ( ) : static Finish the current message.
Use the method only when the message is incomplete.
Throws ParserException when the message is complete
Method getContentLength
public function getContentLength ( ) : int Method getCurrentChunkLength
public function getCurrentChunkLength ( ) : int Method getDataLength
public function getDataLength ( ) : int Returns int the length of the current data
Method getDataOffset
public function getDataOffset ( ) : int Get the offset of the current data.
Returns int the offset. Valid for data events only: URL, HEADER_FIELD, HEADER_VALUE, BODY.
Method getEvent
public function getEvent ( ) : int Method getEventName
public function getEventName ( ) : string Method getEvents
public function getEvents ( ) : int Method getMajorVersion
public function getMajorVersion ( ) : int Method getMethod
public function getMethod ( ) : string Method getMinorVersion
public function getMinorVersion ( ) : int Method getParsedLength
public function getParsedLength ( ) : int Get the bytes that the last execute() call consumed.
Returns int the byte count of the last call, not cumulative
Method getPreviousEvent
public function getPreviousEvent ( ) : int Method getPreviousEventName
public function getPreviousEventName ( ) : string Method getProtocolVersion
public function getProtocolVersion ( ) : string Method getReasonPhrase
public function getReasonPhrase ( ) : string Method getStatusCode
public function getStatusCode ( ) : int Method getType
public function getType ( ) : int Method isChunked
public function isChunked ( ) : bool Method isCompleted
public function isCompleted ( ) : bool Method isMultipart
public function isMultipart ( ) : bool Check whether the parser is in a multipart body.
The parser ignores a boundary shorter than 2 characters.
Returns bool true when the parser is in a multipart body
Method isUpgrade
public function isUpgrade ( ) : bool Method reset
public function reset ( ) : static Reset the parser state.
Method setEvents
public function setEvents ( int $events ) : static Method setType
public function setType ( int $type ) : static Method shouldKeepAlive
public function shouldKeepAlive ( ) : bool