*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
* @todo This template engine does not make use of setTemplateType()
* @throws BasePathReadProtectedException If $templateBasePath is
* read-protected
*/
- public final static function createConsoleTemplateEngine (ManageableApplication $appInstance) {
+ public static final function createConsoleTemplateEngine (ManageableApplication $appInstance) {
// Get a new instance
$templateInstance = new ConsoleTemplateEngine();
- // Get language and file I/O instances from application
- $langInstance = $appInstance->getLanguageInstance();
- $ioInstance = $appInstance->getFileIoInstance();
-
// Determine base path
$templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
throw new BasePathReadProtectedException(array($templateInstance, $templateBasePath), self::EXCEPTION_READ_PROTECED_PATH);
}
- // Get configuration instance
- $configInstance = FrameworkConfiguration::getInstance();
-
// Set the base path
$templateInstance->setTemplateBasePath($templateBasePath);
- // Set the language and IO instances
- $templateInstance->setLanguageInstance($langInstance);
- $templateInstance->setFileIoInstance($ioInstance);
-
// Set template extensions
- $templateInstance->setRawTemplateExtension($configInstance->getConfigEntry('raw_template_extension'));
- $templateInstance->setCodeTemplateExtension($configInstance->getConfigEntry('code_template_extension'));
+ $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
+ $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
- $templateInstance->setCompileOutputPath($configInstance->getConfigEntry('base_path') . $configInstance->getConfigEntry('compile_output_path'));
+ $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path'));
// Return the prepared instance
return $templateInstance;