PHP 클래스 SqlParser\Context

파일 보기 프로젝트 열기: phpmyadmin/sql-parser 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$KEYWORDS array Because, PHP's associative arrays are basically hash tables, it is more efficient to store keywords as keys instead of values. The value associated to each keyword represents its flags.
$MODE integer The mode of the MySQL server that will be used in lexing, parsing and building the statements.
$OPERATORS array List of operators and their flags.
$contextPrefix string The prefix concatenated to the context name when an incomplete class name is specified.
$defaultContext string The name of the default content.
$loadedContext string The name of the loaded context.

공개 메소드들

메소드 설명
escape ( array | string $str, string $quote = '`' ) : string Escapes the symbol by adding surrounding backticks.
isBool ( string $str ) : boolean Checks if the given string is a boolean value.
isComment ( string $str ) : integer Checks if the given string is the beginning of a whitespace.
isKeyword ( string $str, boolean $isReserved = false ) : integer Checks if the given string is a keyword.
isNumber ( string $str ) : boolean Checks if the given character can be a part of a number.
isOperator ( string $str ) : integer Checks if the given string is an operator.
isSeparator ( string $str ) : boolean Checks if the given character can be a separator for two lexeme.
isString ( string $str ) : integer Checks if the given character is the beginning of a string.
isSymbol ( string $str ) : integer Checks if the given character is the beginning of a symbol. A symbol can be either a variable or a field name.
isWhitespace ( string $str ) : boolean Checks if the given character is a whitespace.
load ( string $context = '' ) : void Loads the specified context.
loadClosest ( string $context = '' ) : string Loads the context with the closest version to the one specified.
setMode ( string $mode = '' ) : void Sets the SQL mode.

메소드 상세

escape() 공개 정적인 메소드

Escapes the symbol by adding surrounding backticks.
public static escape ( array | string $str, string $quote = '`' ) : string
$str array | string The string to be escaped.
$quote string Quote to be used when escaping.
리턴 string

isBool() 공개 정적인 메소드

This actually check only for TRUE and FALSE because 1 or 0 are actually numbers and are parsed by specific methods.
public static isBool ( string $str ) : boolean
$str string String to be checked.
리턴 boolean

isComment() 공개 정적인 메소드

Checks if the given string is the beginning of a whitespace.
public static isComment ( string $str ) : integer
$str string String to be checked.
리턴 integer The appropriate flag for the comment type.

isKeyword() 공개 정적인 메소드

Checks if the given string is a keyword.
public static isKeyword ( string $str, boolean $isReserved = false ) : integer
$str string String to be checked.
$isReserved boolean Checks if the keyword is reserved.
리턴 integer

isNumber() 공개 정적인 메소드

Checks if the given character can be a part of a number.
public static isNumber ( string $str ) : boolean
$str string String to be checked.
리턴 boolean

isOperator() 공개 정적인 메소드

Checks if the given string is an operator.
public static isOperator ( string $str ) : integer
$str string String to be checked.
리턴 integer The appropriate flag for the operator.

isSeparator() 공개 정적인 메소드

Checks if the given character can be a separator for two lexeme.
public static isSeparator ( string $str ) : boolean
$str string String to be checked.
리턴 boolean

isString() 공개 정적인 메소드

Checks if the given character is the beginning of a string.
public static isString ( string $str ) : integer
$str string String to be checked.
리턴 integer The appropriate flag for the string type.

isSymbol() 공개 정적인 메소드

Checks if the given character is the beginning of a symbol. A symbol can be either a variable or a field name.
public static isSymbol ( string $str ) : integer
$str string String to be checked.
리턴 integer The appropriate flag for the symbol type.

isWhitespace() 공개 정적인 메소드

Checks if the given character is a whitespace.
public static isWhitespace ( string $str ) : boolean
$str string String to be checked.
리턴 boolean

load() 공개 정적인 메소드

Contexts may be used by accessing the context directly.
public static load ( string $context = '' ) : void
$context string Name of the context or full class name that defines the context.
리턴 void

loadClosest() 공개 정적인 메소드

The closest context is found by replacing last digits with zero until one is loaded successfully.
또한 보기: Context::load()
public static loadClosest ( string $context = '' ) : string
$context string Name of the context or full class name that defines the context.
리턴 string The loaded context. `null` if no context was loaded.

setMode() 공개 정적인 메소드

Sets the SQL mode.
public static setMode ( string $mode = '' ) : void
$mode string The list of modes. If empty, the mode is reset.
리턴 void

프로퍼티 상세

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

Because, PHP's associative arrays are basically hash tables, it is more efficient to store keywords as keys instead of values. The value associated to each keyword represents its flags.
public static array $KEYWORDS
리턴 array

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

The mode of the MySQL server that will be used in lexing, parsing and building the statements.
public static int $MODE
리턴 integer

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

List of operators and their flags.
public static array $OPERATORS
리턴 array

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

The prefix concatenated to the context name when an incomplete class name is specified.
public static string $contextPrefix
리턴 string

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

The name of the default content.
public static string $defaultContext
리턴 string

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

The name of the loaded context.
public static string $loadedContext
리턴 string