cvs: pear /Translation2/Decorator CacheLiteFunction.php
| From: | Lorenzo Alberton | Date: | Thu, 29 Apr 2004 12:46:55 +0000 |
| Subject: | cvs: pear /Translation2/Decorator CacheLiteFunction.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-18937@lists.php.net to get a copy of this message | ||
quipo Thu Apr 29 08:46:55 2004 EDT
Modified files:
/pear/Translation2/Decorator CacheLiteFunction.php
Log:
fix problems with stale $langID and $pageID
http://cvs.php.net/diff.php/pear/Translation2/Decorator/CacheLiteFunction.php?r1=1.4&r2=1.5&ty=u
Index: pear/Translation2/Decorator/CacheLiteFunction.php
diff -u pear/Translation2/Decorator/CacheLiteFunction.php:1.4
pear/Translation2/Decorator/CacheLiteFunction.php:1.5
--- pear/Translation2/Decorator/CacheLiteFunction.php:1.4 Wed Apr 28 07:08:48 2004
+++ pear/Translation2/Decorator/CacheLiteFunction.php Thu Apr 29 08:46:55 2004
@@ -16,11 +16,11 @@
// | Authors: Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
-// $Id: CacheLiteFunction.php,v 1.4 2004/04/28 11:08:48 quipo Exp $
+// $Id: CacheLiteFunction.php,v 1.5 2004/04/29 12:46:55 quipo Exp $
//
/**
* @package Translation2
- * @version $Id: CacheLiteFunction.php,v 1.4 2004/04/28 11:08:48 quipo Exp $
+ * @version $Id: CacheLiteFunction.php,v 1.5 2004/04/29 12:46:55 quipo Exp $
*/
/**
* Load Translation2 decorator base class
@@ -138,9 +138,10 @@
*/
function get($stringID, $pageID=TRANSLATION2_DEFAULT_PAGEID, $langID=null,
$defaultText='')
{
- if (is_null($pageID)) {
+ if ($pageID == TRANSLATION2_DEFAULT_PAGEID) {
$pageID = $this->translation2->currentPageID;
}
+ $langID = empty($langID) ? $this->translation2->lang['id'] : $langID;
$this->_prepare();
global ${$this->tempVarName}; // WITHOUT THIS, IT DOESN'T WORK
@@ -167,9 +168,11 @@
*/
function getRawPage($pageID=TRANSLATION2_DEFAULT_PAGEID, $langID=null)
{
- if (is_null($pageID)) {
+ if ($pageID == TRANSLATION2_DEFAULT_PAGEID) {
$pageID = $this->translation2->currentPageID;
}
+ $langID = empty($langID) ? $this->translation2->lang['id'] : $langID;
+
$this->_prepare();
global ${$this->tempVarName}; // WITHOUT THIS, IT DOESN'T WORK
${$this->tempVarName} = $this->translation2;
@@ -191,9 +194,11 @@
*/
function getPage($pageID=TRANSLATION2_DEFAULT_PAGEID, $langID=null, $defaultText='')
{
- if (is_null($pageID)) {
+ if ($pageID == TRANSLATION2_DEFAULT_PAGEID) {
$pageID = $this->translation2->currentPageID;
}
+ $langID = empty($langID) ? $this->translation2->lang['id'] : $langID;
+
$this->_prepare();
global ${$this->tempVarName}; // WITHOUT THIS, IT DOESN'T WORK
${$this->tempVarName} = $this->translation2;
@@ -216,7 +221,7 @@
*/
function translate($string, $langID, $pageID=TRANSLATION2_DEFAULT_PAGEID)
{
- if (is_null($pageID)) {
+ if ($pageID == TRANSLATION2_DEFAULT_PAGEID) {
$pageID = $this->translation2->currentPageID;
}
$this->_prepare();