Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CS

git-svn-id: http://svn.php.net/repository/pear/packages/Translation2/trunk@246909 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 22252a07f1ee6749d78a5cc55c67013646be8b40 1 parent aa6f714
@quipo quipo authored
View
20 Admin/Container/db.php
@@ -98,7 +98,7 @@ function addLang($langData, $options = array())
}
//table does not exist
- $queries = array();
+ $queries = array();
$queries[] = sprintf('CREATE TABLE %s ( '
.'%s VARCHAR(50) default NULL, '
.'%s TEXT NOT NULL, '
@@ -115,7 +115,7 @@ function addLang($langData, $options = array())
$this->options['string_page_id_col'],
$this->options['string_id_col']
);
- $queries[] = sprintf('CREATE UNIQUE INDEX %s ON %s (%s, %s%s)',
+ $queries[] = sprintf('CREATE UNIQUE INDEX %s ON %s (%s, %s%s)',
$this->db->quoteIdentifier($index_name),
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_page_id_col']),
@@ -127,7 +127,7 @@ function addLang($langData, $options = array())
$langData['table_name'],
$this->options['string_page_id_col']
);
- $queries[] = sprintf('CREATE INDEX %s ON %s (%s)',
+ $queries[] = sprintf('CREATE INDEX %s ON %s (%s)',
$this->db->quoteIdentifier($index_name),
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_page_id_col'])
@@ -137,7 +137,7 @@ function addLang($langData, $options = array())
$langData['table_name'],
$this->options['string_id_col']
);
- $queries[] = sprintf('CREATE INDEX %s ON %s (%s%s)',
+ $queries[] = sprintf('CREATE INDEX %s ON %s (%s%s)',
$this->db->quoteIdentifier($index_name),
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_id_col']),
@@ -178,7 +178,7 @@ function addLangToList($langData)
}
if (!in_array($this->options['langs_avail_table'], $tables)) {
- $queries = array();
+ $queries = array();
$queries[] = sprintf('CREATE TABLE %s ('
.'%s VARCHAR(16), '
.'%s VARCHAR(200), '
@@ -399,7 +399,7 @@ function update($stringID, $pageID, $stringArray)
function _getInsertQuery($table, &$tableLangs, $stringID, $pageID, &$stringArray)
{
$tableCols = $this->_getLangCols($tableLangs);
- $langData = array();
+ $langData = array();
foreach ($tableLangs as $lang) {
$langData[$lang] = $this->db->quote($stringArray[$lang]);
}
@@ -436,7 +436,7 @@ function _getInsertQuery($table, &$tableLangs, $stringID, $pageID, &$stringArray
function _getUpdateQuery($table, &$tableLangs, $stringID, $pageID, &$stringArray)
{
$tableCols = $this->_getLangCols($tableLangs);
- $langSet = array();
+ $langSet = array();
foreach ($tableLangs as $lang) {
$langSet[] = $this->db->quoteIdentifier($tableCols[$lang]) . ' = ' .
$this->db->quote($stringArray[$lang]);
@@ -604,7 +604,7 @@ function &_tableLangs($langs)
function &_getLangTables($langs = null)
{
$tables = array();
- $langs = !is_array($langs) ? $this->getLangs('ids') : $langs;
+ $langs = !is_array($langs) ? $this->getLangs('ids') : $langs;
foreach ($langs as $lang) {
$tables[] = $this->_getLangTable($lang);
}
@@ -653,8 +653,8 @@ function &_getLangCols($langs)
function _recordExists($stringID, $pageID, $table)
{
$stringID = $this->db->quote($stringID, 'text');
- $pageID = is_null($pageID) ? ' IS NULL' : ' = ' . $this->db->quote($pageID);
- $query = sprintf('SELECT COUNT(*) FROM %s WHERE %s=%s AND %s%s',
+ $pageID = is_null($pageID) ? ' IS NULL' : ' = ' . $this->db->quote($pageID);
+ $query = sprintf('SELECT COUNT(*) FROM %s WHERE %s=%s AND %s%s',
$this->db->quoteIdentifier($table),
$this->db->quoteIdentifier($this->options['string_id_col']),
$stringID,
View
24 Admin/Container/mdb.php
@@ -108,7 +108,7 @@ function addLang($langData, $options = array())
$this->options['string_page_id_col'],
$this->options['string_id_col']
);
- $queries[] = sprintf('CREATE UNIQUE INDEX %s ON %s (%s, %s%s)',
+ $queries[] = sprintf('CREATE UNIQUE INDEX %s ON %s (%s, %s%s)',
$this->db->quoteIdentifier($index_name),
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_page_id_col']),
@@ -120,7 +120,7 @@ function addLang($langData, $options = array())
$langData['table_name'],
$this->options['string_page_id_col']
);
- $queries[] = sprintf('CREATE INDEX %s ON %s (%s)',
+ $queries[] = sprintf('CREATE INDEX %s ON %s (%s)',
$this->db->quoteIdentifier($index_name),
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_page_id_col'])
@@ -130,7 +130,7 @@ function addLang($langData, $options = array())
$langData['table_name'],
$this->options['string_id_col']
);
- $queries[] = sprintf('CREATE INDEX %s ON %s (%s%s)',
+ $queries[] = sprintf('CREATE INDEX %s ON %s (%s%s)',
$this->db->quoteIdentifier($index_name),
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_id_col']),
@@ -171,7 +171,7 @@ function addLangToList($langData)
}
if (!in_array($this->options['langs_avail_table'], $tables)) {
- $queries = array();
+ $queries = array();
$queries[] = sprintf('CREATE TABLE %s ('
.'%s VARCHAR(16), '
.'%s VARCHAR(200), '
@@ -285,7 +285,7 @@ function updateLang($langData)
'encoding' => 'lang_encoding_col',
);
$updateFields = array_keys($langData);
- $langSet = array();
+ $langSet = array();
foreach ($allFields as $field => $col) {
if (in_array($field, $updateFields)) {
$langSet[] = $this->db->quoteIdentifier($this->options[$col]) . ' = ' .
@@ -335,8 +335,8 @@ function add($stringID, $pageID, $stringArray)
$unquoted_stringID = $stringID;
$unquoted_pageID = $pageID;
- $stringID = $this->db->getTextValue($stringID);
- $pageID = is_null($pageID) ? 'NULL' : $this->db->getTextValue($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) {
$exists = $this->_recordExists($unquoted_stringID, $unquoted_pageID, $table);
@@ -392,7 +392,7 @@ function update($stringID, $pageID, $stringArray)
function _getInsertQuery($table, &$tableLangs, $stringID, $pageID, &$stringArray)
{
$tableCols = $this->_getLangCols($tableLangs);
- $langData = array();
+ $langData = array();
foreach ($tableLangs as $lang) {
$langData[$lang] = $this->db->getTextValue($stringArray[$lang]);
}
@@ -429,7 +429,7 @@ function _getInsertQuery($table, &$tableLangs, $stringID, $pageID, &$stringArray
function _getUpdateQuery($table, &$tableLangs, $stringID, $pageID, &$stringArray)
{
$tableCols = $this->_getLangCols($tableLangs);
- $langSet = array();
+ $langSet = array();
foreach ($tableLangs as $lang) {
$langSet[] = $this->db->quoteIdentifier($tableCols[$lang]) . ' = ' .
$this->db->getTextValue($stringArray[$lang]);
@@ -597,7 +597,7 @@ function &_tableLangs($langs)
function &_getLangTables($langs = null)
{
$tables = array();
- $langs = !is_array($langs) ? $this->getLangs('ids') : $langs;
+ $langs = !is_array($langs) ? $this->getLangs('ids') : $langs;
foreach ($langs as $lang) {
$tables[] = $this->_getLangTable($lang);
}
@@ -646,8 +646,8 @@ function &_getLangCols($langs)
function _recordExists($stringID, $pageID, $table)
{
$stringID = $this->db->getTextValue($stringID);
- $pageID = is_null($pageID) ? ' IS NULL' : ' = ' . $this->db->getTextValue($pageID);
- $query = sprintf('SELECT COUNT(*) FROM %s WHERE %s=%s AND %s%s',
+ $pageID = is_null($pageID) ? ' IS NULL' : ' = ' . $this->db->getTextValue($pageID);
+ $query = sprintf('SELECT COUNT(*) FROM %s WHERE %s=%s AND %s%s',
$this->db->quoteIdentifier($table),
$this->db->quoteIdentifier($this->options['string_id_col']),
$stringID,
View
46 Admin/Container/mdb2.php
@@ -206,7 +206,7 @@ function addLangToList($langData)
}
if (!in_array($this->options['langs_avail_table'], $tables)) {
- $queries = array();
+ $queries = array();
$queries[] = sprintf('CREATE TABLE %s ('
.'%s VARCHAR(16), '
.'%s VARCHAR(200), '
@@ -237,17 +237,17 @@ function addLangToList($langData)
}
$query = sprintf('INSERT INTO %s (%s, %s, %s, %s, %s) VALUES (%s, %s, %s, %s, %s)',
- $this->db->quoteIdentifier($this->options['langs_avail_table'], true),
- $this->db->quoteIdentifier($this->options['lang_id_col'], true),
- $this->db->quoteIdentifier($this->options['lang_name_col'], true),
- $this->db->quoteIdentifier($this->options['lang_meta_col'], true),
- $this->db->quoteIdentifier($this->options['lang_errmsg_col'], true),
- $this->db->quoteIdentifier($this->options['lang_encoding_col'], true),
- $this->db->quote($langData['lang_id']),
- $this->db->quote($langData['name']),
- $this->db->quote($langData['meta']),
- $this->db->quote($langData['error_text']),
- $this->db->quote($langData['encoding'])
+ $this->db->quoteIdentifier($this->options['langs_avail_table'], true),
+ $this->db->quoteIdentifier($this->options['lang_id_col'], true),
+ $this->db->quoteIdentifier($this->options['lang_name_col'], true),
+ $this->db->quoteIdentifier($this->options['lang_meta_col'], true),
+ $this->db->quoteIdentifier($this->options['lang_errmsg_col'], true),
+ $this->db->quoteIdentifier($this->options['lang_encoding_col'], true),
+ $this->db->quote($langData['lang_id']),
+ $this->db->quote($langData['name']),
+ $this->db->quote($langData['meta']),
+ $this->db->quote($langData['error_text']),
+ $this->db->quote($langData['encoding'])
);
++$this->_queries;
@@ -323,7 +323,7 @@ function updateLang($langData)
'encoding' => 'lang_encoding_col',
);
$updateFields = array_keys($langData);
- $langSet = array();
+ $langSet = array();
foreach ($allFields as $field => $col) {
if (in_array($field, $updateFields)) {
$langSet[] = $this->db->quoteIdentifier($this->options[$col], true) . ' = ' .
@@ -342,7 +342,7 @@ function updateLang($langData)
$this->fetchLangs(); //update memory cache
if (PEAR::isError($res)) {
return $res;
- }
+ }
return true;
}
@@ -376,8 +376,8 @@ function add($stringID, $pageID, $stringArray)
$unquoted_stringID = $stringID;
$unquoted_pageID = $pageID;
- $stringID = $this->db->quote($stringID, 'text');
- $pageID = is_null($pageID) ? 'NULL' : $this->db->quote($pageID, 'text');
+ $stringID = $this->db->quote($stringID, 'text');
+ $pageID = is_null($pageID) ? 'NULL' : $this->db->quote($pageID, 'text');
// Loop over the tables we need to insert into.
foreach ($this->_tableLangs($langs) as $table => $tableLangs) {
$exists = $this->_recordExists($unquoted_stringID, $unquoted_pageID, $table);
@@ -509,10 +509,10 @@ function remove($stringID, $pageID)
continue;
}
$query = sprintf('DELETE FROM %s WHERE %s = %s AND %s',
- $this->db->quoteIdentifier($table, true),
- $this->db->quoteIdentifier($this->options['string_id_col'], true),
- $stringID,
- $this->db->quoteIdentifier($this->options['string_page_id_col'], true)
+ $this->db->quoteIdentifier($table, true),
+ $this->db->quoteIdentifier($this->options['string_id_col'], true),
+ $stringID,
+ $this->db->quoteIdentifier($this->options['string_page_id_col'], true)
);
if (is_null($pageID)) {
$query .= ' IS NULL';
@@ -638,7 +638,7 @@ function &_tableLangs($langs)
function &_getLangTables($langs = null)
{
$tables = array();
- $langs = !is_array($langs) ? $this->getLangs('ids') : $langs;
+ $langs = !is_array($langs) ? $this->getLangs('ids') : $langs;
foreach ($langs as $lang) {
$tables[] = $this->_getLangTable($lang);
}
@@ -687,8 +687,8 @@ function &_getLangCols($langs)
function _recordExists($stringID, $pageID, $table)
{
$stringID = $this->db->quote($stringID, 'text');
- $pageID = is_null($pageID) ? ' IS NULL' : ' = ' . $this->db->quote($pageID, 'text');
- $query = sprintf('SELECT COUNT(*) FROM %s WHERE %s=%s AND %s%s',
+ $pageID = is_null($pageID) ? ' IS NULL' : ' = ' . $this->db->quote($pageID, 'text');
+ $query = sprintf('SELECT COUNT(*) FROM %s WHERE %s=%s AND %s%s',
$this->db->quoteIdentifier($table, true),
$this->db->quoteIdentifier($this->options['string_id_col'], true),
$stringID,
View
2  Container/db.php
@@ -276,7 +276,7 @@ function getOne($stringID, $pageID = null, $langID = null)
++$this->_queries;
return $this->db->getOne($query);
- }
+ }
// }}}
// {{{ getStringID()
Please sign in to comment.
Something went wrong with that request. Please try again.