From: Roland Haeder Date: Sun, 9 Feb 2014 00:25:21 +0000 (+0100) Subject: Converted more double-quotes to single. This causes some speed improvement as X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=57bbfb3dec01126b0e4e0b2cdebaca155880cc54 Converted more double-quotes to single. This causes some speed improvement as double-quoted texts are parsed for variables, but single-quoted not. Signed-off-by: Roland Häder --- diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 4948b28f..6b8145f4 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -724,7 +724,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Is language support enabled? if ($this->isLanguageSupportEnabled()) { // Construct the FQFN for the template by honoring the current language - $fqfn = sprintf("%s%s%s%s/%s/%s%s", + $fqfn = sprintf('%s%s%s%s/%s/%s%s', $this->getConfigInstance()->getConfigEntry('base_path'), $this->getTemplateBasePath(), $this->getGenericBasePath(), @@ -735,7 +735,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { ); } else { // Construct the FQFN for the template without language - $fqfn = sprintf("%s%s%s%s/%s%s", + $fqfn = sprintf('%s%s%s%s/%s%s', $this->getConfigInstance()->getConfigEntry('base_path'), $this->getTemplateBasePath(), $this->getGenericBasePath(), @@ -1256,7 +1256,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $this->finalizeVariableCompilation(); // Prepare the eval() command for comiling the template - $eval = sprintf("\$result = \"%s\";", + $eval = sprintf('$result = "%s";', addslashes($this->getRawTemplateData()) ); @@ -1276,14 +1276,14 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $evalRight = substr($evalRight, (strpos($evalRight, $this->codeEnd) + 2)); // And put all together - $eval = sprintf("%s<%%php %s %%>%s", $evalLeft, $evalMiddle, $evalRight); + $eval = sprintf('%s<%%php %s %%>%s', $evalLeft, $evalMiddle, $evalRight); } // END - while // Prepare PHP code for eval() command $eval = str_replace( - "<%php", "\";", + '<%php', '";', str_replace( - "%>", + '%>', "\n\$result .= \"", $eval ) @@ -1295,7 +1295,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Goes something wrong? if ((!isset($result)) || (empty($result))) { // Output eval command - self::createDebugInstance(__CLASS__)->debugOutput(sprintf("Failed eval() code:
%s
", $this->markupCode($eval, TRUE)), TRUE); + self::createDebugInstance(__CLASS__)->debugOutput(sprintf('Failed eval() code:
%s
', $this->markupCode($eval, TRUE)), TRUE); // Output backtrace here $this->debugBackTrace();