cvs: pear /MDB_QueryTool/QueryTool Query.php

From: Date: Sun, 25 Feb 2007 11:27:30 +0000
Subject: cvs: pear /MDB_QueryTool/QueryTool Query.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44871@lists.php.net to get a copy of this message
quipo Sun Feb 25 11:27:30 2007 UTC Modified files: /pear/MDB_QueryTool/QueryTool Query.php Log: revert latest commit http://cvs.php.net/viewvc.cgi/pear/MDB_QueryTool/QueryTool/Query.php?r1=1.69&r2=1.70&diff_format=u Index: pear/MDB_QueryTool/QueryTool/Query.php diff -u pear/MDB_QueryTool/QueryTool/Query.php:1.69 pear/MDB_QueryTool/QueryTool/Query.php:1.70 --- pear/MDB_QueryTool/QueryTool/Query.php:1.69 Fri Feb 23 15:47:19 2007 +++ pear/MDB_QueryTool/QueryTool/Query.php Sun Feb 25 11:27:29 2007 @@ -32,7 +32,7 @@ * @author Lorenzo Alberton <l dot alberton at quipo dot it> * @copyright 2004-2007 Lorenzo Alberton * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) - * @version CVS: $Id: Query.php,v 1.69 2007/02/23 15:47:19 hugoki Exp $ + * @version CVS: $Id: Query.php,v 1.70 2007/02/25 11:27:29 quipo Exp $ * @link http://pear.php.net/package/MDB_QueryTool */ @@ -363,8 +363,6 @@ } else { $this->db->setFetchMode(MDB_FETCHMODE_ASSOC); } - //Setting the quoting - $this->db->setOption('quote_identifier', !$this->options['raw']); } // }}} @@ -684,14 +682,14 @@ if (isset($newData[$this->primaryCol])) { //$this->_errorSet('Error updating the new member.'); //return false; - $query['where'] = $this->db->quoteIdentifier($this->primaryCol, true).'='.$this->_quote($newData[$this->primaryCol]); + $query['where'] = $this->db->quoteIdentifier($this->primaryCol).'='.$this->_quote($newData[$this->primaryCol]); } $newData = $this->_checkColumns($newData, 'update'); $values = array(); foreach ($newData as $key => $aData) { // quote the data //$values[] = "{$this->table}.$key=" . $this->_quote($aData); - $values[] = $this->db->quoteIdentifier($key, true) . '=' . $this->_quote($aData); + $values[] = $this->db->quoteIdentifier($key) . '=' . $this->_quote($aData); } $query['set'] = $this->_localeSafeImplode(',', $values); @@ -736,7 +734,7 @@ //quoting the columns $tmpData = array(); foreach ($newData as $key=>$val) { - $tmpData[$this->db->quoteIdentifier($key, true)] = $val; + $tmpData[$this->db->quoteIdentifier($key)] = $val; } $newData = $tmpData; unset($tmpData); @@ -794,7 +792,7 @@ //quoting the columns $tmpData = array(); foreach ($aData as $key=>$val) { - $tmpData[$this->db->quoteIdentifier($key, true)] = $val; + $tmpData[$this->db->quoteIdentifier($key)] = $val; } $newData = $tmpData; unset($tmpData); @@ -847,9 +845,9 @@ $wheres = array(); foreach ($data as $key => $val) { if (is_null($val)) { - $wheres[] = $this->db->quoteIdentifier($key, true) .' IS NULL'; + $wheres[] = $this->db->quoteIdentifier($key) .' IS NULL'; } else { - $wheres[] = $this->db->quoteIdentifier($key, true) .'='. $this->_quote($val); + $wheres[] = $this->db->quoteIdentifier($key) .'='. $this->_quote($val); } } $whereClause = implode(' AND ', $wheres); @@ -857,7 +855,7 @@ if (empty($whereCol)) { $whereCol = $this->primaryCol; } - $whereClause = $this->db->quoteIdentifier($whereCol, true).'='. $this->_quote($data); + $whereClause = $this->db->quoteIdentifier($whereCol).'='. $this->_quote($data); } $query = 'DELETE FROM '. $this->table .' WHERE '. $whereClause; @@ -1492,11 +1490,6 @@ function setOption($option, $value) { $this->options[strtolower($option)] = $value; - if (strtolower($option)=='raw') { - //Setting the quoting - $this->db->setOption('quote_identifier', !$this->options['raw']); - } - } // }}} @@ -1921,7 +1914,7 @@ if ($this->db->phptype == 'ibase') { $cols[$aTable][] = $this->table. '.' .$colName . ' AS '. $colName; } else { - $cols[$aTable][] = $this->table. '.' .$colName . ' AS '. $this->db->quoteIdentifier($colName, true); + $cols[$aTable][] = $this->table. '.' .$colName . ' AS '. $this->db->quoteIdentifier($colName); } } else { if ($this->db->phptype == 'ibase') { @@ -1932,7 +1925,7 @@ //an "invalid token" error $cols[$aTable][] = $aTable. '.' .$colName . ' AS t_'. $this->getTableShortName($aTable) .'_'. $colName; } else { - $cols[$aTable][] = $aTable. '.' .$colName . ' AS '. $this->db->quoteIdentifier('_'. $this->getTableShortName($aTable) .'_'. $colName, true); + $cols[$aTable][] = $aTable. '.' .$colName . ' AS '. $this->db->quoteIdentifier('_'. $this->getTableShortName($aTable) .'_'. $colName); } } } @@ -1998,7 +1991,7 @@ // quotations of columns $columns = explode(',', $what); - $identifier = substr($this->db->quoteIdentifier('', true), 0, 1); + $identifier = substr($this->db->quoteIdentifier(''), 0, 1); for ($i=0; $i<sizeof($columns); $i++) { $column = trim($columns[$i]); // Uppercasing "as" @@ -2007,13 +2000,13 @@ $column = explode(' AS ', $column); if (strpos($column[0], '(') !== false) { //do not quote function calls, COUNT(), etc. - $column[1] = $this->db->quoteIdentifier($column[1], true); + $column[1] = $this->db->quoteIdentifier($column[1]); } elseif (strpos($column[0], '.') !== false) { $column[0] = explode('.', $column[0]); - $column[0][1] = $this->db->quoteIdentifier($column[0][1], true); + $column[0][1] = $this->db->quoteIdentifier($column[0][1]); $column[0] = implode('.', $column[0]); } else { - $column[0] = $this->db->quoteIdentifier($column[0], true); + $column[0] = $this->db->quoteIdentifier($column[0]); } $column = implode(' AS ', $column); } else { @@ -2021,10 +2014,10 @@ //do not quote function calls, COUNT(), etc. } elseif (strpos($column, '.') !== false) { $column = explode('.', $column); - $column[1] = $this->db->quoteIdentifier($column[1], true); + $column[1] = $this->db->quoteIdentifier($column[1]); $column = implode('.', $column); } else { - $column = $this->db->quoteIdentifier($column, true); + $column = $this->db->quoteIdentifier($column); } } // Clean up if a function was used in the query

« previous php.pear.cvs (#44871) next »