X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ftemplate%2Fconsole%2Fclass_ConsoleTemplateEngine.php;h=4a55c27342b5ef66a091b70b673790902f2f8f49;hp=aae8d6c8951faf482938598e1d76643f75c5ec62;hb=5203f9bd014ad46fbc7ee54e7223dcd46e14e3b4;hpb=e51607c0f33062258ba0a07b79b8e1f34fd6b832 diff --git a/inc/classes/main/template/console/class_ConsoleTemplateEngine.php b/inc/classes/main/template/console/class_ConsoleTemplateEngine.php index aae8d6c8..4a55c273 100644 --- a/inc/classes/main/template/console/class_ConsoleTemplateEngine.php +++ b/inc/classes/main/template/console/class_ConsoleTemplateEngine.php @@ -2,11 +2,11 @@ /** * A Console template engine class * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * @todo This template engine does not make use of setTemplateType() * * This program is free software: you can redistribute it and/or modify @@ -36,8 +36,7 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $appInstance A manageable application - * @return $templateInstance An instance of TemplateEngine + * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string * @throws BasePathIsNoDirectoryException If $templateBasePath is no @@ -45,12 +44,15 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createConsoleTemplateEngine (ManageableApplication $appInstance) { + public static final function createConsoleTemplateEngine () { // Get a new instance $templateInstance = new ConsoleTemplateEngine(); + // Get the application instance from registry + $applicationInstance = Registry::getRegistry()->getInstance('app'); + // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; // Is the base path valid? if (empty($templateBasePath)) {