# classes/phing/tasks/ext/pdo/PgsqlPDOQuerySplitter.php

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information please see http://phing.info.

package
  phing.tasks.ext.pdo
version
  SVN: $Id: PgsqlPDOQuerySplitter.php 1274 2011-08-17 13:38:07Z mrook $

## \PgsqlPDOQuerySplitter
jump to top

Splits PostgreSQL's dialect of SQL into separate queries

Unlike DefaultPDOQuerySplitter this uses a lexer instead of regular expressions. This allows handling complex constructs like C-style comments (including nested ones) and dollar-quoted strings.

Extends from
  \PDOQuerySplitter
author
  Alexey Borzov
link
  http://www.phing.info/trac/ticket/499
link
  http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING
package
  phing.tasks.ext.pdo
version
  $Revision: 1274 $

### Constants

`STATE_NORMAL = '0'`

`STATE_SINGLE_QUOTED = '1'`

`STATE_DOUBLE_QUOTED = '2'`

`STATE_DOLLAR_QUOTED = '3'`

`STATE_COMMENT_LINEEND = '4'`

`STATE_COMMENT_MULTILINE = '5'`

`STATE_BACKSLASH = '6'`

### Properties

`int $commentDepth= '0'`

Nesting depth of current multiline comment

Default value `0` Details

Type
  int

`bool $escape= 'false'`

Whether a backslash was just encountered in quoted string

Default value `false` Details

Type
  bool

`int $inputIndex= ''`

Position in current source line

Details

Type
  int

`string $line= ''`

Current source line being examined

Details

Type
  string

`string $quotingTag= ''`

Current dollar-quoting "tag"

Details

Type
  string

`int $state= 'self'`

Current lexer state, one of STATE_* constants

Default value `self` Details

Type
  int

### Methods

`checkDollarQuote( ) : string|bool`
Checks whether symbols after $ are a valid dollar-quoting tag
Returns

Type | Description
--- | ---
stringbool |

`getc( ) : string|bool`
Gets next symbol from the input, false if at end
Returns

Type | Description
--- | ---
stringbool |

`nextQuery( ) :`
`ungetc( ) :`
Bactracks one symbol on the input

NB: we don't need ungetc() at the start of the line, so this case is not handled.

Documentation was generated by DocBlox 0.13.1.