PHP 클래스 PHPSQLParser\PHPSQLParser

저자: Justin Swanhart ([email protected])
저자: André Rothe ([email protected])
파일 보기 프로젝트 열기: greenlion/php-sql-parser 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$parsed

공개 메소드들

메소드 설명
__construct ( String | boolean $sql = false, boolean $calcPositions = false, array $options = [] ) Constructor. It simply calls the parse() function.
addCustomFunction ( String $token ) : null Add a custom function to the parser. no return value
getCustomFunctions ( ) : array Returns the list of custom functions
parse ( String $sql, boolean $calcPositions = false ) : array It parses the given SQL statement and generates a detailled output array for every part of the statement. The method can also generate [position] fields within the output, which hold the character position for every statement part. The calculation of the positions needs some time, if you don't need positions in your application, set the parameter to false.
removeCustomFunction ( String $token ) : null Remove a custom function from the parser. no return value

메소드 상세

__construct() 공개 메소드

Use the public variable $parsed to get the output.
public __construct ( String | boolean $sql = false, boolean $calcPositions = false, array $options = [] )
$sql String | boolean The SQL statement.
$calcPositions boolean True, if the output should contain [position], false otherwise.
$options array

addCustomFunction() 공개 메소드

Add a custom function to the parser. no return value
public addCustomFunction ( String $token ) : null
$token String The name of the function to add
리턴 null

getCustomFunctions() 공개 메소드

Returns the list of custom functions
public getCustomFunctions ( ) : array
리턴 array Returns an array of all custom functions

parse() 공개 메소드

It parses the given SQL statement and generates a detailled output array for every part of the statement. The method can also generate [position] fields within the output, which hold the character position for every statement part. The calculation of the positions needs some time, if you don't need positions in your application, set the parameter to false.
public parse ( String $sql, boolean $calcPositions = false ) : array
$sql String The SQL statement.
$calcPositions boolean True, if the output should contain [position], false otherwise.
리턴 array An associative array with all meta information about the SQL statement.

removeCustomFunction() 공개 메소드

Remove a custom function from the parser. no return value
public removeCustomFunction ( String $token ) : null
$token String The name of the function to remove
리턴 null

프로퍼티 상세

$parsed 공개적으로 프로퍼티

public $parsed