本文整理汇总了PHP中DevblocksPlatform::getLocaleService方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::getLocaleService方法的具体用法?PHP DevblocksPlatform::getLocaleService怎么用?PHP DevblocksPlatform::getLocaleService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevblocksPlatform
的用法示例。
在下文中一共展示了DevblocksPlatform::getLocaleService方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTranslationService
/**
* @return Zend_Translate
*/
static function getTranslationService()
{
$cache = self::getCacheService();
$locale = DevblocksPlatform::getLocaleService();
if (false === ($translate = $cache->load(self::CACHE_TRANSLATIONS))) {
$translate = new Zend_Translate('tmx', DEVBLOCKS_PATH . 'resources/strings.xml', $locale);
// [JAS]: Read in translations from the extension point
if (!self::isDatabaseEmpty()) {
$translations = DevblocksPlatform::getExtensions("devblocks.i18n.strings");
if (is_array($translations)) {
foreach ($translations as $translationManifest) {
/* @var $translationManifest DevblocksExtensionManifest */
$translation = $translationManifest->createInstance();
/* @var $translation DevblocksTranslationsExtension */
$file = $translation->getTmxFile();
if (@is_readable($file)) {
$translate->addTranslation($file, $locale);
}
}
}
$cache->save($translate, self::CACHE_TRANSLATIONS);
}
}
return $translate;
}
示例2: die
}
@chmod(DEVBLOCKS_PATH . 'tmp/', 0774);
@chmod(DEVBLOCKS_PATH . 'tmp/templates_c/', 0774);
@chmod(DEVBLOCKS_PATH . 'tmp/cache/', 0774);
// Make sure the temporary directories of Devblocks are writeable.
if (!is_writeable(DEVBLOCKS_PATH . "tmp/")) {
die(realpath(DEVBLOCKS_PATH . "tmp/") . " is not writeable by the webserver. Please adjust permissions and reload this page.");
}
if (!is_writeable(DEVBLOCKS_PATH . "tmp/templates_c/")) {
die(realpath(DEVBLOCKS_PATH . "tmp/templates_c/") . " is not writeable by the webserver. Please adjust permissions and reload this page.");
}
if (!is_writeable(DEVBLOCKS_PATH . "tmp/cache/")) {
die(realpath(DEVBLOCKS_PATH . "tmp/cache/") . " is not writeable by the webserver. Please adjust permissions and reload this page.");
}
// [TODO] Move this to the framework init (installer blocks this at the moment)
$locale = DevblocksPlatform::getLocaleService();
$locale->setLocale('en_US');
// [JAS]: Translations
// [TODO] Should probably cache this
// [TODO] This breaks if you change the platform tables (it needs to look up plugins)
$translate = DevblocksPlatform::getTranslationService();
$translate->addTranslation(APP_PATH . '/install/strings.xml', $locale);
//$date = DevblocksPlatform::getDateService();
//echo sprintf($translate->_('installer.today'),$date->get(Zend_Date::WEEKDAY));
// Get a reference to the template system and configure it
$tpl = DevblocksPlatform::getTemplateService();
$tpl->template_dir = APP_PATH . '/install/templates';
$tpl->caching = 0;
$tpl->assign('translate', $translate);
$tpl->assign('step', $step);
switch ($step) {