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