當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DevblocksPlatform::getLocaleService方法代碼示例

本文整理匯總了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;
 }
開發者ID:sluther,項目名稱:portsensor,代碼行數:28,代碼來源:Devblocks.class.php

示例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) {
開發者ID:sluther,項目名稱:portsensor,代碼行數:31,代碼來源:index.php


注:本文中的DevblocksPlatform::getLocaleService方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。