X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fclass_BaseFrameworkSystem.php;h=485264212e4c82a58bd55ad776eb3543f243439a;hp=9b153224b9a9398514f4364023f56f2642e7472c;hb=e51607c0f33062258ba0a07b79b8e1f34fd6b832;hpb=83ceb6f4eb20c78b5e83842bf3bb84cd5758a647 diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 9b153224..48526421 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -5,7 +5,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 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 * @@ -197,8 +197,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { const EXCEPTION_ATTRIBUTES_ARE_MISSING = 0x02b; const EXCEPTION_ARRAY_ELEMENTS_MISSING = 0x02c; const EXCEPTION_TEMPLATE_ENGINE_UNSUPPORTED = 0x02d; - const EXCEPTION_MISSING_LANGUAGE_HANDLER = 0x02e; - const EXCEPTION_MISSING_FILE_IO_HANDLER = 0x02f; const EXCEPTION_MISSING_ELEMENT = 0x030; const EXCEPTION_HEADERS_ALREADY_SENT = 0x031; const EXCEPTION_DEFAULT_CONTROLLER_GONE = 0x032; @@ -626,7 +624,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { if ((!isset($this->decimals)) || (!isset($this->thousands))) { // Throw an exception throw new MissingDecimalsThousandsSeperatorException($this, self::EXCEPTION_ATTRIBUTES_ARE_MISSING); - } + } // END - if // Cast the number $value = (float) $value; @@ -667,7 +665,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public final function addMissingTrailingSlash ($str) { // Is there a trailing slash? - if (substr($str, -1, 1) != '/') $str .= '/'; + if (substr($str, -1, 1) != '/') { + $str .= '/'; + } // END - if + + // Return string with trailing slash return $str; } @@ -696,17 +698,15 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * * @param $appInstance An application helper instance or * null if we shall use the default - * @return $templateInstance The template engine instance + * @return $templateInstance The template engine instance * @throws NullPointerException If the template engine could not * be initialized * @throws UnsupportedTemplateEngineException If $templateInstance is an * unsupported template engine - * @throws MissingLanguageHandlerException If the language sub-system - * is not yet initialized * @throws NullPointerException If the discovered application * instance is still null */ - protected function prepareTemplateInstance (FrameworkInterface $appInstance=null) { + protected function prepareTemplateInstance (ManageableApplication $appInstance = null) { // Is the application instance set? if (is_null($appInstance)) { // Get the current instance @@ -719,15 +719,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } // END - if } // END - if - // Are both instances set? - if ($appInstance->getLanguageInstance() === null) { - // Invalid language instance - throw new MissingLanguageHandlerException($appInstance, self::EXCEPTION_MISSING_LANGUAGE_HANDLER); - } elseif ($appInstance->getFileIoInstance() === null) { - // Invalid language instance - throw new MissingFileIoHandlerException($appInstance, self::EXCEPTION_MISSING_FILE_IO_HANDLER); - } - // Initialize the template engine $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class', array($appInstance));