cvs: pear /Translation2/Container db.php mdb.php mdb2.php

From: Date: Thu, 16 Dec 2004 18:29:37 +0000
Subject: cvs: pear /Translation2/Container db.php mdb.php mdb2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-27495@lists.php.net to get a copy of this message
quipo Thu Dec 16 13:29:37 2004 EDT Modified files: /pear/Translation2/Container db.php mdb.php mdb2.php Log: removed useless table prefix in getOne() http://cvs.php.net/diff.php/pear/Translation2/Container/db.php?r1=1.22&r2=1.23&ty=u Index: pear/Translation2/Container/db.php diff -u pear/Translation2/Container/db.php:1.22 pear/Translation2/Container/db.php:1.23 --- pear/Translation2/Container/db.php:1.22 Tue Dec 14 15:03:33 2004 +++ pear/Translation2/Container/db.php Thu Dec 16 13:29:37 2004 @@ -16,11 +16,11 @@ // | Author: Lorenzo Alberton <l dot alberton at quipo dot it> | // +----------------------------------------------------------------------+ // -// $Id: db.php,v 1.22 2004/12/14 20:03:33 quipo Exp $ +// $Id: db.php,v 1.23 2004/12/16 18:29:37 quipo Exp $ // /** * @package Translation2 - * @version $Id: db.php,v 1.22 2004/12/14 20:03:33 quipo Exp $ + * @version $Id: db.php,v 1.23 2004/12/16 18:29:37 quipo Exp $ */ /** @@ -35,7 +35,7 @@ * by the PEAR DB abstraction layer to fetch data. * * @package Translation2 - * @version $Revision: 1.22 $ + * @version $Revision: 1.23 $ */ class Translation2_Container_db extends Translation2_Container { @@ -196,6 +196,7 @@ while (list($key, $value) = $res->fetchRow()) { $strings[$key] = $value; } + $res->free(); return $strings; } @@ -203,7 +204,7 @@ // {{{ getOne() /** - * Get a single item from the container, without caching the whole page + * Get a single item from the container * * @param string $stringID * @param string $pageID @@ -216,10 +217,9 @@ $lang_col = $this->_getLangCol($langID); $table = $this->_getLangTable($langID); - $query = sprintf('SELECT %s FROM %s WHERE %s.%s = %s AND %s', + $query = sprintf('SELECT %s FROM %s WHERE %s = %s AND %s', $lang_col, $table, - $table, $this->options['string_id_col'], $this->db->quote($stringID), $this->options['string_page_id_col'] http://cvs.php.net/diff.php/pear/Translation2/Container/mdb.php?r1=1.16&r2=1.17&ty=u Index: pear/Translation2/Container/mdb.php diff -u pear/Translation2/Container/mdb.php:1.16 pear/Translation2/Container/mdb.php:1.17 --- pear/Translation2/Container/mdb.php:1.16 Tue Dec 14 15:03:33 2004 +++ pear/Translation2/Container/mdb.php Thu Dec 16 13:29:37 2004 @@ -16,11 +16,11 @@ // | Author: Lorenzo Alberton <l dot alberton at quipo dot it> | // +----------------------------------------------------------------------+ // -// $Id: mdb.php,v 1.16 2004/12/14 20:03:33 quipo Exp $ +// $Id: mdb.php,v 1.17 2004/12/16 18:29:37 quipo Exp $ // /** * @package Translation2 - * @version $Id: mdb.php,v 1.16 2004/12/14 20:03:33 quipo Exp $ + * @version $Id: mdb.php,v 1.17 2004/12/16 18:29:37 quipo Exp $ */ /** @@ -35,7 +35,7 @@ * by the PEAR MDB abstraction layer to fetch data. * * @package Translation2 - * @version $Revision: 1.16 $ + * @version $Revision: 1.17 $ */ class Translation2_Container_mdb extends Translation2_Container { @@ -203,7 +203,7 @@ // {{{ getOne() /** - * Get a single item from the container, without caching the whole page + * Get a single item from the container * * @param string $stringID * @param string $pageID @@ -216,10 +216,9 @@ $lang_col = $this->_getLangCol($langID); $table = $this->_getLangTable($langID); - $query = sprintf('SELECT %s FROM %s WHERE %s.%s = %s AND %s', + $query = sprintf('SELECT %s FROM %s WHERE %s = %s AND %s', $lang_col, $table, - $table, $this->options['string_id_col'], $this->db->getTextValue($stringID), $this->options['string_page_id_col'] http://cvs.php.net/diff.php/pear/Translation2/Container/mdb2.php?r1=1.14&r2=1.15&ty=u Index: pear/Translation2/Container/mdb2.php diff -u pear/Translation2/Container/mdb2.php:1.14 pear/Translation2/Container/mdb2.php:1.15 --- pear/Translation2/Container/mdb2.php:1.14 Tue Dec 14 15:03:33 2004 +++ pear/Translation2/Container/mdb2.php Thu Dec 16 13:29:37 2004 @@ -16,11 +16,11 @@ // | Author: Lorenzo Alberton <l dot alberton at quipo dot it> | // +----------------------------------------------------------------------+ // -// $Id: mdb2.php,v 1.14 2004/12/14 20:03:33 quipo Exp $ +// $Id: mdb2.php,v 1.15 2004/12/16 18:29:37 quipo Exp $ // /** * @package Translation2 - * @version $Id: mdb2.php,v 1.14 2004/12/14 20:03:33 quipo Exp $ + * @version $Id: mdb2.php,v 1.15 2004/12/16 18:29:37 quipo Exp $ */ /** @@ -35,7 +35,7 @@ * by the PEAR MDB2 abstraction layer to fetch data. * * @package Translation2 - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ */ class Translation2_Container_mdb2 extends Translation2_Container { @@ -203,7 +203,7 @@ // {{{ getOne() /** - * Get a single item from the container, without caching the whole page + * Get a single item from the container * * @param string $stringID * @param string $pageID @@ -216,10 +216,9 @@ $lang_col = $this->_getLangCol($langID); $table = $this->_getLangTable($langID); - $query = sprintf('SELECT %s FROM %s WHERE %s.%s = %s AND %s', + $query = sprintf('SELECT %s FROM %s WHERE %s = %s AND %s', $lang_col, $table, - $table, $this->options['string_id_col'], $this->db->quote($stringID, 'text'), $this->options['string_page_id_col'] @@ -230,7 +229,7 @@ } else { $query .= ' = ' . $this->db->quote($pageID, 'text'); } - + ++$this->_queries; return $this->db->queryOne($query); }

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