Permalink
Browse files

- fixed a few PHP5 NOTICEs

- request #13734: added 'string_page_id_col_length' option to set the size of the pageID field in the translations table
- going stable


git-svn-id: http://svn.php.net/repository/pear/packages/Translation2/trunk@258951 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent ca476f9 commit 9505575b01329e3bf9a2a7bc15df92c732bae8d0 @quipo quipo committed May 3, 2008
Showing with 35 additions and 14 deletions.
  1. +2 −2 Admin.php
  2. +2 −1 Admin/Container/db.php
  3. +2 −1 Admin/Container/mdb.php
  4. +1 −1 Admin/Container/mdb2.php
  5. +1 −0 Container/db.php
  6. +1 −0 Container/mdb.php
  7. +1 −0 Container/mdb2.php
  8. +25 −9 package.xml
View
4 Admin.php
@@ -78,7 +78,7 @@ class Translation2_Admin extends Translation2
*/
function & factory($driver, $options = '', $params = array())
{
- $tr =& new Translation2_Admin;
+ $tr = new Translation2_Admin;
$tr->storage = Translation2_Admin::_storageFactory($driver, $options);
if (PEAR::isError($tr->storage)) {
return $tr->storage;
@@ -112,7 +112,7 @@ function & _storageFactory($driver, $options = '')
$storage_path = 'Translation2/Admin/Container/'.strtolower($driver).'.php';
$storage_class = 'Translation2_Admin_Container_'.strtolower($driver);
include_once $storage_path;
- $storage =& new $storage_class;
+ $storage = new $storage_class;
$err = $storage->init($options);
if (PEAR::isError($err)) {
return $err;
View
3 Admin/Container/db.php
@@ -100,11 +100,12 @@ function addLang($langData, $options = array())
//table does not exist
$queries = array();
$queries[] = sprintf('CREATE TABLE %s ( '
- .'%s VARCHAR(50) default NULL, '
+ .'%s VARCHAR(%d) default NULL, '
.'%s TEXT NOT NULL, '
.'%s TEXT )',
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_page_id_col']),
+ (int)$this->options['string_page_id_col_length'],
$this->db->quoteIdentifier($this->options['string_id_col']),
$this->db->quoteIdentifier($lang_col)
);
View
3 Admin/Container/mdb.php
@@ -93,11 +93,12 @@ function addLang($langData, $options = array())
//table does not exist
$queries = array();
$queries[] = sprintf('CREATE TABLE %s ( '
- .'%s VARCHAR(50) default NULL, '
+ .'%s VARCHAR(%d) default NULL, '
.'%s TEXT NOT NULL, '
.'%s TEXT )',
$this->db->quoteIdentifier($langData['table_name']),
$this->db->quoteIdentifier($this->options['string_page_id_col']),
+ (int)$this->options['string_page_id_col_length'],
$this->db->quoteIdentifier($this->options['string_id_col']),
$this->db->quoteIdentifier($lang_col)
);
View
2 Admin/Container/mdb2.php
@@ -119,7 +119,7 @@ function addLang($langData, $options = array())
$table_definition = array(
$this->options['string_page_id_col'] => array(
'type' => 'text',
- 'length' => 50,
+ 'length' => $this->options['string_page_id_col_length'],
'default' => null,
'charset' => $charset,
'collation' => $collation,
View
1 Container/db.php
@@ -149,6 +149,7 @@ function _setDefaultOptions()
$this->options['strings_tables'] = array(); // 'lang_id' => 'table_name'
$this->options['string_id_col'] = 'id';
$this->options['string_page_id_col'] = 'page_id';
+ $this->options['string_page_id_col_length'] = 50;
$this->options['string_text_col'] = '%s'; // col_name if one table per lang is used,
// or a pattern (i.e. "tr_%s" => "tr_EN_US")
}
View
1 Container/mdb.php
@@ -147,6 +147,7 @@ function _setDefaultOptions()
$this->options['strings_tables'] = array(); // 'lang_id' => 'table_name'
$this->options['string_id_col'] = 'id';
$this->options['string_page_id_col'] = 'page_id';
+ $this->options['string_page_id_col_length'] = 50;
$this->options['string_text_col'] = '%s'; // col_name if one table per lang is used,
// or a pattern (i.e. "tr_%s" => "tr_EN_US")
}
View
1 Container/mdb2.php
@@ -146,6 +146,7 @@ function _setDefaultOptions()
$this->options['strings_tables'] = array(); // 'lang_id' => 'table_name'
$this->options['string_id_col'] = 'id';
$this->options['string_page_id_col'] = 'page_id';
+ $this->options['string_page_id_col_length'] = 50;
$this->options['string_text_col'] = '%s'; // col_name if one table per lang is used,
// or a pattern (i.e. "tr_%s" => "tr_EN_US")
}
View
34 package.xml
@@ -45,20 +45,20 @@ Currently, the following decorators are provided:
<email>mike@php.net</email>
<active>yes</active>
</developer>
- <date>2008-02-23</date>
- <time>14:38:30</time>
+ <date>2008-05-03</date>
+ <time>11:20:00</time>
<version>
- <release>2.0.0RC4</release>
- <api>2.0.0RC4</api>
+ <release>2.0.0</release>
+ <api>2.0.0</api>
</version>
<stability>
- <release>beta</release>
- <api>beta</api>
+ <release>stable</release>
+ <api>stable</api>
</stability>
<license uri="http://www.debian.org/misc/bsd.license">BSD</license>
- <notes>- fixed bug #12703: CacheLiteFunction decorator and getLang() issue
-- fixed some E_STRICT warnings
-- fixed getStringID()
+ <notes>- fixed a few PHP5 NOTICEs
+- request #13734: added 'string_page_id_col_length' option to set the size of the
+ pageID field in the translations table
</notes>
<contents>
<dir name="/">
@@ -195,6 +195,22 @@ Currently, the following decorators are provided:
<changelog>
<release>
<version>
+ <release>2.0.0</release>
+ <api>2.0.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2008-05-03</date>
+ <license uri="http://www.debian.org/misc/bsd.license">BSD</license>
+ <notes>- fixed a few PHP5 NOTICEs
+- request #13734: added 'string_page_id_col_length' option to set the size of the
+ pageID field in the translations table
+ </notes>
+ </release>
+ <release>
+ <version>
<release>2.0.0RC4</release>
<api>2.0.0RC4</api>
</version>

0 comments on commit 9505575

Please sign in to comment.