summaryrefslogtreecommitdiff
path: root/framework/I18N
diff options
context:
space:
mode:
Diffstat (limited to 'framework/I18N')
-rw-r--r--framework/I18N/TChoiceFormat.php1
-rw-r--r--framework/I18N/TDateFormat.php1
-rw-r--r--framework/I18N/TGlobalization.php1
-rw-r--r--framework/I18N/TI18NControl.php1
-rw-r--r--framework/I18N/TNumberFormat.php1
-rw-r--r--framework/I18N/TTranslate.php1
-rw-r--r--framework/I18N/TTranslateParameter.php1
-rw-r--r--framework/I18N/Translation.php1
-rw-r--r--framework/I18N/core/CultureInfo.php2
-rw-r--r--framework/I18N/core/MessageCache.php48
-rw-r--r--framework/I18N/core/TCache_Lite.php1
11 files changed, 23 insertions, 36 deletions
diff --git a/framework/I18N/TChoiceFormat.php b/framework/I18N/TChoiceFormat.php
index ab19b27b..4525aaad 100644
--- a/framework/I18N/TChoiceFormat.php
+++ b/framework/I18N/TChoiceFormat.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TChoiceFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TDateFormat.php b/framework/I18N/TDateFormat.php
index fa6d27cf..e7846be7 100644
--- a/framework/I18N/TDateFormat.php
+++ b/framework/I18N/TDateFormat.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDateFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index 16cd68a9..3fbaa2b4 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TGlobalization.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TI18NControl.php b/framework/I18N/TI18NControl.php
index a1fb59e4..96fc8b62 100644
--- a/framework/I18N/TI18NControl.php
+++ b/framework/I18N/TI18NControl.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TI18NControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TNumberFormat.php b/framework/I18N/TNumberFormat.php
index bb3c1784..89eab245 100644
--- a/framework/I18N/TNumberFormat.php
+++ b/framework/I18N/TNumberFormat.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TNumberFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php
index 0f8de2ee..1365b937 100644
--- a/framework/I18N/TTranslate.php
+++ b/framework/I18N/TTranslate.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTranslate.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TTranslateParameter.php b/framework/I18N/TTranslateParameter.php
index 2a1dfd77..d5c41230 100644
--- a/framework/I18N/TTranslateParameter.php
+++ b/framework/I18N/TTranslateParameter.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTranslateParameter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/Translation.php b/framework/I18N/Translation.php
index 8ded0903..9592ef53 100644
--- a/framework/I18N/Translation.php
+++ b/framework/I18N/Translation.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Translation.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php
index c22ed5c4..fc20b833 100644
--- a/framework/I18N/core/CultureInfo.php
+++ b/framework/I18N/core/CultureInfo.php
@@ -13,7 +13,6 @@
* {@link http://prado.sourceforge.net/}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.I18N.core
*/
@@ -44,7 +43,6 @@
* For example, Australian English is "en_AU".
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.I18N.core
*/
class CultureInfo
diff --git a/framework/I18N/core/MessageCache.php b/framework/I18N/core/MessageCache.php
index 3bd21704..ad310258 100644
--- a/framework/I18N/core/MessageCache.php
+++ b/framework/I18N/core/MessageCache.php
@@ -2,7 +2,6 @@
/**
* Translation table cache.
* @author $Author: weizhuo $
- * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.I18N.core
*/
@@ -16,9 +15,8 @@ require_once(dirname(__FILE__).'/TCache_Lite.php');
* It can cache each cataloug+variant or just the whole section.
* @package System.I18N.core
* @author $Author: weizhuo $
- * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $
*/
-class MessageCache
+class MessageCache
{
/**
@@ -31,16 +29,16 @@ class MessageCache
* Caceh life time, default is 1 year.
*/
protected $lifetime = 3153600;
-
+
/**
* Create a new Translation cache.
* @param string $cacheDir Directory to store the cache files.
*/
public function __construct($cacheDir)
- {
+ {
$cacheDir = $cacheDir.'/';
-
+
if(!is_dir($cacheDir))
throw new Exception(
'The cache directory '.$cacheDir.' does not exists.'.
@@ -49,7 +47,7 @@ class MessageCache
throw new Exception(
'The cache directory '.$cacheDir.' must be writable '.
'by the server.');
-
+
$options = array(
'cacheDir' => $cacheDir,
'lifeTime' => $this->getLifeTime(),
@@ -102,31 +100,31 @@ class MessageCache
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
* @param string $filename If the source is a file, this file's modified
- * time is newer than the cache's modified time, no cache hit.
+ * time is newer than the cache's modified time, no cache hit.
* @return mixed Boolean FALSE if no cache hit. Otherwise, translation
* table data for the specified section and locale.
*/
- public function get($catalogue, $culture, $lastmodified=0)
+ public function get($catalogue, $culture, $lastmodified=0)
{
$ID = $this->getID($catalogue, $culture);
- $group = $this->getGroup($catalogue, $culture);
+ $group = $this->getGroup($catalogue, $culture);
$this->cache->_setFileName($ID, $group);
$cache = $this->cache->getCacheFile();
-
- if(is_file($cache) == false)
+
+ if(is_file($cache) == false)
return false;
$lastmodified = (int)$lastmodified;
-
+
if($lastmodified <= 0 || $lastmodified > filemtime($cache))
- return false;
-
+ return false;
+
//echo '@@ Cache hit: "'.$ID.'" : "'.$group.'"';
//echo "<br>\n";
-
+
return $this->cache->get($ID, $group);
}
@@ -136,28 +134,28 @@ class MessageCache
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
*/
- public function save($data, $catalogue, $culture)
- {
+ public function save($data, $catalogue, $culture)
+ {
$ID = $this->getID($catalogue, $culture);
- $group = $this->getGroup($catalogue, $culture);
-
+ $group = $this->getGroup($catalogue, $culture);
+
//echo '## Cache save: "'.$ID.'" : "'.$group.'"';
//echo "<br>\n";
-
+
return $this->cache->save($data, $ID, $group);
}
-
+
/**
* Clean up the cache for the specified section and locale.
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
*/
- public function clean($catalogue, $culture)
+ public function clean($catalogue, $culture)
{
- $group = $this->getGroup($catalogue, $culture);
+ $group = $this->getGroup($catalogue, $culture);
$this->cache->clean($group);
}
-
+
/**
* Flush the cache. Deletes all the cache files.
*/
diff --git a/framework/I18N/core/TCache_Lite.php b/framework/I18N/core/TCache_Lite.php
index a0629bd1..69e1c308 100644
--- a/framework/I18N/core/TCache_Lite.php
+++ b/framework/I18N/core/TCache_Lite.php
@@ -38,7 +38,6 @@
* Mike BENOIT <ipso@snappymail.ca>
*
* @package System.I18N.core
-* @version $Id: TCache_Lite.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @author Fabien MARTY <fab@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.gnu.org/copyleft/lesser.html GNU LGPL