cvs: pear /Translation2/Admin/Container mdb.php

From: Date: Thu, 15 Dec 2005 08:49:15 +0000
Subject: cvs: pear /Translation2/Admin/Container mdb.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-36876@lists.php.net to get a copy of this message
quipo Thu Dec 15 08:49:15 2005 EDT Modified files: /pear/Translation2/Admin/Container mdb.php Log: remove old duplicate code (bug #6233) http://cvs.php.net/viewcvs.cgi/pear/Translation2/Admin/Container/mdb.php?r1=1.27&r2=1.28&diff_format=u Index: pear/Translation2/Admin/Container/mdb.php diff -u pear/Translation2/Admin/Container/mdb.php:1.27 pear/Translation2/Admin/Container/mdb.php:1.28 --- pear/Translation2/Admin/Container/mdb.php:1.27 Thu Sep 8 17:27:37 2005 +++ pear/Translation2/Admin/Container/mdb.php Thu Dec 15 08:49:15 2005 @@ -32,7 +32,7 @@ * @author Lorenzo Alberton <l dot alberton at quipo dot it> * @copyright 2004-2005 Lorenzo Alberton * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) - * @version CVS: $Id: mdb.php,v 1.27 2005/09/08 17:27:37 quipo Exp $ + * @version CVS: $Id: mdb.php,v 1.28 2005/12/15 08:49:15 quipo Exp $ * @link http://pear.php.net/package/Translation2 */ @@ -326,46 +326,6 @@ } } - - $unquoted_stringID = $stringID; - $unquoted_pageID = $pageID; - $stringID = $this->db->getTextValue($stringID); - $pageID = is_null($pageID) ? 'NULL' : $this->db->getTextValue($pageID); - // Loop over the tables we need to insert into. - foreach ($this->_tableLangs($langs) as $table => $tableLangs) { - //before INSERTing a new record, check if it exists already. - $exists = $this->_recordExists($unquoted_stringID, $unquoted_pageID, $table); - if (PEAR::isError($exists)) { - return $exists; - } - if ($exists) { - $this->update($unquoted_stringID, $unquoted_pageID, - $this->_filterStringsByTable($stringArray, $table)); - continue; - } - - $tableCols = $this->_getLangCols($tableLangs); - $langData = array(); - foreach ($tableLangs as $lang) { - $langData[$lang] = $this->db->getTextValue($stringArray[$lang]); - } - - $query = sprintf('INSERT INTO %s (%s, %s, %s) VALUES (%s, %s, %s)', - $table, - $this->options['string_id_col'], - $this->options['string_page_id_col'], - implode(', ', $tableCols), - $stringID, - $pageID, - implode(', ', $langData) - ); - ++$this->_queries; - $res = $this->db->query($query); - if (PEAR::isError($res)) { - return $res; - } - } - return true; }

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