本文整理匯總了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);