本文整理汇总了PHP中Zend\Locale\Locale::setFallback方法的典型用法代码示例。如果您正苦于以下问题:PHP Locale::setFallback方法的具体用法?PHP Locale::setFallback怎么用?PHP Locale::setFallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Locale\Locale
的用法示例。
在下文中一共展示了Locale::setFallback方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Setup environment
*/
public function setUp()
{
$this->_originaltimezone = date_default_timezone_get();
date_default_timezone_set('America/Chicago');
Locale::setFallback('en_US');
Parser\TypeLoader::resetMap();
$this->_response = new \Zend\Amf\Response\StreamResponse();
}
示例2: setUp
/**
* Setup environment
*/
public function setUp()
{
$this->_originaltimezone = date_default_timezone_get();
date_default_timezone_set("America/Chicago");
\Zend\Locale\Locale::setFallback('en');
Parser\TypeLoader::resetMap();
$this->_request = new \Zend\Amf\Request\StreamRequest();
}
示例3: getLocale
/**
* Retrieve locale object
*
* @return \Zend\Locale\Locale
*/
public function getLocale()
{
if (null === $this->_locale) {
$options = $this->getOptions();
if (!isset($options['default'])) {
$this->_locale = new SystemLocale\Locale();
} elseif (!isset($options['force']) || (bool) $options['force'] == false) {
// Don't force any locale, just go for auto detection
SystemLocale\Locale::setFallback($options['default']);
$this->_locale = new SystemLocale\Locale();
} else {
$this->_locale = new SystemLocale\Locale($options['default']);
}
$key = isset($options['registry_key']) && !is_numeric($options['registry_key']) ? $options['registry_key'] : self::DEFAULT_REGISTRY_KEY;
\Zend\Registry::set($key, $this->_locale);
}
return $this->_locale;
}
示例4: dirname
<?php
// Set used namespaces
use Zend\Loader\StandardAutoloader;
use Zend\Locale\Locale;
use Zend\Service\LiveDocx\Helper;
// Turn up error reporting
error_reporting(E_ALL | E_STRICT);
// Library base
$base = dirname(dirname(dirname(dirname(__DIR__))));
// Set up autoloader
require_once "{$base}/library/Zend/Loader/StandardAutoloader.php";
$loader = new StandardAutoloader();
$loader->registerNamespace('Zend', "{$base}/library/Zend");
$loader->register();
// Include utility class
require_once "{$base}/demos/Zend/Service/LiveDocx/library/Zend/Service/LiveDocx/Helper.php";
// Set fallback locale
Locale::setFallback(Helper::LOCALE);
// Ensure LiveDocx credentials are available
if (false === Helper::credentialsAvailable()) {
Helper::printLine(Helper::credentialsHowTo());
exit;
}
unset($base);