From: Reini U. <ru...@us...> - 2004-11-27 14:39:17
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11759/WikiDB Modified Files: ADODB.php SQL.php backend.php Log Message: simpified regex search architecture: no db specific node methods anymore, new sql() method for each node parallel to regexp() (which returns pcre) regex types bitmasked (op's not yet) new regex=sql clarified WikiDB::quote() backend methods: ->quote() adds surrounsing quotes ->qstr() (new method) assumes strings and adds no quotes! (in contrast to ADODB) pear and adodb have now unified quote methods for all generic queries. Index: ADODB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/ADODB.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -2 -b -p -d -r1.8 -r1.9 --- ADODB.php 10 Nov 2004 19:32:23 -0000 1.8 +++ ADODB.php 27 Nov 2004 14:39:04 -0000 1.9 @@ -45,5 +45,5 @@ class WikiDB_ADODB extends WikiDB } - // ADODB handles everything as string + // add surrounding quotes '' if string function quote ($in) { if (is_int($in) || is_double($in)) { @@ -57,4 +57,9 @@ class WikiDB_ADODB extends WikiDB } } + // ADODB handles everything as string + // Don't add surrounding quotes '', same as in PearDB + function qstr ($in) { + return $this->_backend->_dbh->addq($in); + } function isOpen () { Index: SQL.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/SQL.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -2 -b -p -d -r1.10 -r1.11 --- SQL.php 10 Nov 2004 15:29:21 -0000 1.10 +++ SQL.php 27 Nov 2004 14:39:05 -0000 1.11 @@ -52,8 +52,8 @@ class WikiDB_SQL extends WikiDB } - // return with surrounding quotes as ADODB! - function quote ($s) { - return $this->_backend->_dbh->quoteSmart($s); - } + // adds surrounding quotes + function quote ($s) { return $this->_backend->_dbh->quoteSmart($s); } + // no surrounding quotes because we know it's a string + function qstr ($s) { return $this->_backend->_dbh->escapeSimple($s); } function isOpen () { Index: backend.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -2 -b -p -d -r1.16 -r1.17 --- backend.php 26 Nov 2004 18:39:02 -0000 1.16 +++ backend.php 27 Nov 2004 14:39:05 -0000 1.17 @@ -522,9 +522,8 @@ class WikiDB_backend } - // quote only strings or do smartquote? add ' or not? (NULL) - // ADODB adds surrounding quotes, SQL not yet! - function quote ($s) { - return $s; - } + // adds surrounding quotes + function quote ($s) { return "'".$s."'"; } + // no surrounding quotes because we know it's a string + function qstr ($s) { return $s; } }; |