Skip to content

Commit

Permalink
Merge branch 'ZF-11055' of https://github.com/thomasweidner/zf2 into …
Browse files Browse the repository at this point in the history
…zf2/master
  • Loading branch information
weierophinney committed Feb 23, 2011
2 parents e620169 + 098467a commit 45a7842
Show file tree
Hide file tree
Showing 12 changed files with 692 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
</entry>
</row>
<row>
<entry morerows="7" valign="middle">
<entry morerows="9" valign="middle">
<emphasis>
<ulink
url="&php.manual.link;/ref.iconv.php">iconv</ulink>
Expand Down Expand Up @@ -538,6 +538,22 @@
</ulink>
</entry>
</row>
<row>
<entry>
<ulink
url="&zf.manual.link;/zend.validate.hostname.html">
<classname>Zend_Validate_Hostname</classname>
</ulink>
</entry>
</row>
<row>
<entry>
<ulink
url="&zf.manual.link;/zend.validate.stringlength.html">
<classname>Zend_Validate_StringLength</classname>
</ulink>
</entry>
</row>
<row>
<entry>
<ulink
Expand Down
30 changes: 30 additions & 0 deletions documentation/manual/en/ref/requirements-zendcomponents-table.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,36 @@
url="&php.manual.link;/book.reflection.php">Reflection</ulink>
</entry>
</row>
<row>
<entry>
<emphasis>
<ulink
url="&zf.manual.link;/zend.validate.hostname.html">
<classname>Zend_Validate_Hostname</classname>
</ulink>
</emphasis>
</entry>
<entry>&requirements.hard;</entry>
<entry>
<ulink
url="&php.manual.link;/ref.iconv.php">iconv</ulink>
</entry>
</row>
<row>
<entry>
<emphasis>
<ulink
url="&zf.manual.link;/zend.validate.stringlength.html">
<classname>Zend_Validate_StringLength</classname>
</ulink>
</emphasis>
</entry>
<entry>&requirements.hard;</entry>
<entry>
<ulink
url="&php.manual.link;/ref.iconv.php">iconv</ulink>
</entry>
</row>
<row>
<entry>
<emphasis>
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Date/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static function setOptions(array $options = array())
}

parent::$_cache = $value;
parent::$_cacheTags = Zend_Date_DateObject::_getTagSupportForCache();
parent::$_cacheTags = Zend_Date_DateObject::hasCacheTagSupport();
Cldr::setCache($value);
}
break;
Expand Down
127 changes: 88 additions & 39 deletions library/Zend/Locale/Data/AbstractLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,6 @@
*/
abstract class AbstractLocale
{
/**
* Locale files
*
* @var ressource
* @access private
*/
private static $_ldml = array();

/**
* List of values which are collected
*
* @var array
* @access private
*/
private static $_list = array();

/**
* Internal cache for ldml values
*
Expand All @@ -82,27 +66,6 @@ abstract class AbstractLocale
*/
protected static $_cacheTags = false;

/**
* Internal function for checking the locale
*
* @param string|\Zend\Locale $locale Locale to check
* @return string
*/
protected static function _checkLocale($locale)
{
if (empty($locale)) {
$locale = new Locale();
}

if (!(Locale::isLocale((string) $locale))) {
throw new InvalidArgumentException(
"Locale (" . (string) $locale . ") is no known locale"
);
}

return (string) $locale;
}

/**
* Returns the set cache
*
Expand Down Expand Up @@ -170,19 +133,39 @@ public static function clearCache($tag = null)
/**
* Disables the cache
*
* @param unknown_type $flag
* @param boolean $flag
*/
public static function disableCache($flag)
{
self::$_cacheDisabled = (boolean) $flag;
}

/**
* Returns true when the cache is disabled
*
* @return boolean
*/
public static function isCacheDisabled()
{
return self::$_cacheDisabled;
}

/**
* Returns true when the actual set cache supports tags
*
* @return boolean
*/
public static function hasCacheTagSupport()
{
return self::$_cacheTags;
}

/**
* Internal method to check if the given cache supports tags
*
* @return false|string
*/
private static function _getTagSupportForCache()
protected static function _getTagSupportForCache()
{
$backend = self::$_cache->getBackend();
if ($backend instanceof \Zend\Cache\Backend\ExtendedInterface) {
Expand All @@ -194,4 +177,70 @@ private static function _getTagSupportForCache()

return self::$_cacheTags;
}

/**
* Returns detailed informations from the language table
* If no detail is given a complete table is returned
*
* @param string $locale Normalized locale
* @param boolean $reverse Invert output of the data
* @param string|array $detail Detail to return information for
* @return array
*/
public static function getDisplayLanguage($locale, $invert = false, $detail = null)
{
throw new UnsupportedMethod('This implementation does not support the selected locale information');
}

/**
* Returns detailed informations from the script table
* If no detail is given a complete table is returned
*
* @param string $locale Normalized locale
* @param boolean $invert Invert output of the data
* @param string|array $detail Detail to return information for
* @return array
*/
public static function getDisplayScript($locale, $invert = false, $detail = null)
{
throw new UnsupportedMethod('This implementation does not support the selected locale information');
}

/**
* Returns detailed informations from the territory table
* If no detail is given a complete table is returned
*
* @param string $locale Normalized locale
* @param boolean $invert Invert output of the data
* @param string|array $detail Detail to return information for
* @return array
*/
public static function getDisplayTerritory($locale, $invert = false, $detail = null)
{
throw new UnsupportedMethod('This implementation does not support the selected locale information');
}

/**
* Returns detailed informations from the variant table
* If no detail is given a complete table is returned
*
* @param string $locale Normalized locale
* @param boolean $invert Invert output of the data
* @param string|array $detail Detail to return information for
* @return array
*/
public static function getDisplayVariant($locale, $invert = false, $detail = null)
{
throw new UnsupportedMethod('This implementation does not support the selected locale information');
}

public static function toInteger()
public static function toFloat()
public static function toDecimal()
public static function toScientific()

public static function toCurrency()

public static function toArray()
public static function toDateString()
}
Loading

0 comments on commit 45a7842

Please sign in to comment.