本文整理汇总了PHP中I18n::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP I18n::factory方法的具体用法?PHP I18n::factory怎么用?PHP I18n::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I18n
的用法示例。
在下文中一共展示了I18n::factory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadDefaultLibs
/**
* Loads the default most commonly used libraries for the framework
*
* @return object
*/
public function loadDefaultLibs()
{
$config = Registry::get('config');
foreach ($this->defaultLibs as $library) {
if ($library == 'cache') {
try {
$cache = Cache::factory($config->get('cache/type'));
} catch (Config_KeyNoExist $e) {
// Revert to file based caching.
$cache = Cache::factory('file');
}
try {
$cache->ttl($config->get('cache/ttl'));
} catch (Exception $e) {
}
} else {
if ($library == 'i18n') {
try {
I18n::factory($config->get('locale/engine'));
} catch (Config_KeyNoExist $e) {
I18n::factory('failsafe');
}
} else {
$this->loadLib($library);
}
}
}
return $this;
}
示例2: sprintf
<?php
/**
* Zula Framework setup specific
* Does specific tasks that may be needed, such as adding new config values that previous
* versions of Zula may not have had (If you are upgrading, for example).
*
* @patches submit all patches to patches@tangocms.org
*
* @author Alex Cartwright
* @author Robert Clipsham
* @copyright Copyright (C) 2007, 2008, 2009, 2010 Alex Cartwright
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU/LGPL 2.1
* @package Zula_Install
*/
Registry::get('cache')->purge();
Registry::unregister('cache');
Cache::factory('disabled');
I18n::factory('gettext_php');
$config->update('config/title', sprintf(t('%s %s setup'), _PROJECT_NAME, _PROJECT_LATEST_VERSION));
$config->update('acl/enable', 0);