mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Change DBParser.class.php to support left and right escape char. This change is required for unit tests.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8441 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
0e3043d678
commit
251555245d
1 changed files with 10 additions and 6 deletions
|
|
@ -1,19 +1,23 @@
|
|||
<?php
|
||||
class DBParser {
|
||||
var $escape_char;
|
||||
var $escape_char_left;
|
||||
var $escape_char_right;
|
||||
var $table_prefix;
|
||||
|
||||
function DBParser($escape_char, $table_prefix = "xe_"){
|
||||
$this->escape_char = $escape_char;
|
||||
function DBParser($escape_char_left, $escape_char_right = "", $table_prefix = "xe_"){
|
||||
$this->escape_char_left = $escape_char_left;
|
||||
if ($escape_char_right !== "")$this->escape_char_right = $escape_char_right;
|
||||
else $this->escape_char_right = $escape_char_left;
|
||||
$this->table_prefix = $table_prefix;
|
||||
}
|
||||
|
||||
function getEscapeChar(){
|
||||
return $this->escape_char;
|
||||
function getEscapeChar($leftOrRight){
|
||||
if ($leftOrRight === 'left')return $this->escape_char_left;
|
||||
else return $this->escape_char_right;
|
||||
}
|
||||
|
||||
function escape($name){
|
||||
return $this->escape_char . $name . $this->escape_char;
|
||||
return $this->escape_char_left . $name . $this->escape_char_right;
|
||||
}
|
||||
|
||||
function escapeString($name){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue