X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Ftemplate%2Fmail%2Fclass_MailTemplateEngine.php;h=436b39b2ce84ccef52bb98d15373967f6082aee5;hp=8f031a85419d6b31f5616f78b8d6de02c8eaab11;hb=8d8cf621bd811811cecd83c65a4ab91f27258e79;hpb=78a010fef84895720e796842208f01dfb619c332 diff --git a/framework/main/classes/template/mail/class_MailTemplateEngine.php b/framework/main/classes/template/mail/class_MailTemplateEngine.php index 8f031a85..436b39b2 100644 --- a/framework/main/classes/template/mail/class_MailTemplateEngine.php +++ b/framework/main/classes/template/mail/class_MailTemplateEngine.php @@ -1,11 +1,18 @@ getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/'; // Is the base path valid? if (empty($templateBasePath)) { // Base path is empty - throw new BasePathIsEmptyException($templateInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } elseif (!is_string($templateBasePath)) { // Is not a string - throw new InvalidBasePathStringException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_STRING); + throw new UnexpectedValueException(sprintf('[%s:%d] %s is not a string with a base path.', $templateInstance->__toString(), __LINE__, $templateBasePath), self::EXCEPTION_INVALID_STRING); } elseif (!is_dir($templateBasePath)) { // Is not a path - throw new BasePathIsNoDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); + throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); } elseif (!is_readable($templateBasePath)) { // Is not readable throw new BasePathReadProtectedException(array($templateInstance, $templateBasePath), self::EXCEPTION_READ_PROTECED_PATH); @@ -112,7 +118,10 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension')); // Absolute output path for compiled templates - $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')); + $templateInstance->setCompileOutputPath(sprintf('%s%s/', + $templateBasePath, + $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path') + )); // Return the prepared instance return $templateInstance; @@ -318,21 +327,6 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $this->getMailerInstance()->invokeMailDelivery(); } - /** - * Getter for image cache file (FQFN) - * - * @return $fqfn Full-qualified file name of the image cache - * @todo 0% done - */ - public function getMailCacheFqfn () { - // Initialize FQFN - $fqfn = ''; - $this->debugBackTrace('Unfinished area!'); - - // Return it - return $fqfn; - } - /** * Setter for mailer instance *