summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2007-07-26 01:21:43 +0000
committerxue <>2007-07-26 01:21:43 +0000
commit7ca846467da923a2bd39ef3f554e26e1f589c85e (patch)
tree879f0134d1ae217b92183d7283f8ca8ee7d514b1
parent21dde48b3caf7ee8aff1343c22f6ef5c18ee167b (diff)
Fixed #678.
-rw-r--r--HISTORY3
-rw-r--r--framework/I18N/core/CultureInfo.php12
-rw-r--r--framework/I18N/core/DateTimeFormatInfo.php2
3 files changed, 15 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 23a57104..33dbc7b5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6,8 +6,9 @@ BUG: Ticket#662 - Ensure TForm to properly encode the ampersand in action URL (Q
BUG: Ticket#666 - TActiveRecord::deleteAll() method always requires a criteria or null parameter (Qiang)
BUG: Ticket#670 - TDatePicker: Year Issue (Christophe)
BUG: Ticket#648 - Validation: onClick and onBlur events order (Christophe)
-ENH: Ticket#667 - Added TFeedService.ContentType property (Qiang)
ENH: Ticket#577 - Added image button support for TPager (Qiang)
+ENH: Ticket#667 - Added TFeedService.ContentType property (Qiang)
+ENH: Ticket#678 - Improved DateTimeFormatInfo performance (Stever)
ENH: Added THead requirement check (Qiang)
CHG: GeSHi is replaced with Text_Highlighter (Christophe)
NEW: Added TTabPanel (Qiang)
diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php
index 404c81fe..15370ebe 100644
--- a/framework/I18N/core/CultureInfo.php
+++ b/framework/I18N/core/CultureInfo.php
@@ -201,6 +201,18 @@ class CultureInfo
}
/**
+ * Gets the CultureInfo that for this culture string
+ * @return CultureInfo invariant culture info is "en".
+ */
+ public static function getInstance($culture)
+ {
+ static $instances = array();
+ if(!isset($instances[$culture]))
+ $instances[$culture] = new CultureInfo($culture);
+ return $instances[$culture];
+ }
+
+ /**
* Determine if a given culture is valid. Simply checks that the
* culture data exists.
* @param string a culture
diff --git a/framework/I18N/core/DateTimeFormatInfo.php b/framework/I18N/core/DateTimeFormatInfo.php
index 685a95c1..04ed0e73 100644
--- a/framework/I18N/core/DateTimeFormatInfo.php
+++ b/framework/I18N/core/DateTimeFormatInfo.php
@@ -173,7 +173,7 @@ class DateTimeFormatInfo
return $culture->getDateTimeFormat();
else if(is_string($culture))
{
- $cultureInfo = new CultureInfo($culture);
+ $cultureInfo = CultureInfo::getInstance($culture);
return $cultureInfo->getDateTimeFormat();
}
else