/** * @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; }
} @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) {