class BufferedQuery

Buffer query utilities.

Implements a specialized lexer used to extract statements from large inputs that are being buffered. After each statement has been extracted, a lexer or a parser may be used.

Constants

STATUS_STRING

STATUS_STRING_SINGLE_QUOTES

STATUS_STRING_DOUBLE_QUOTES

STATUS_STRING_BACKTICK

STATUS_COMMENT

STATUS_COMMENT_BASH

STATUS_COMMENT_C

STATUS_COMMENT_SQL

Properties

string $query The query that is being processed.
array $options The options of this parser.
string $delimiter The last delimiter used.
int $delimiterLen The length of the delimiter.
int $status The current status of the parser.
string $current The last incomplete query that was extracted.

Methods

__construct(string $query = '', array $options = array())

Constructor.

setDelimiter(string $delimiter)

Sets the delimiter.

string
extract(bool $end = false)

Extracts a statement from the buffer.

Details

at line 88
__construct(string $query = '', array $options = array())

Constructor.

Parameters

string $query the query to be parsed
array $options the options of this parser

at line 129
setDelimiter(string $delimiter)

Sets the delimiter.

Used to update the length of it too.

Parameters

string $delimiter

at line 142
string extract(bool $end = false)

Extracts a statement from the buffer.

Parameters

bool $end whether the end of the buffer was reached

Return Value

string