From cd036561c5408332c4ccaf45fd92e095d4d66815 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Fri, 13 Mar 2020 10:22:03 -0400 Subject: [PATCH] [#14907] - Removed cache parsing from Volt --- phalcon/Mvc/View/Engine/Volt/Compiler.zep | 12 +++------- .../Volt/Compiler/CompileStringCest.php | 24 ------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/phalcon/Mvc/View/Engine/Volt/Compiler.zep b/phalcon/Mvc/View/Engine/Volt/Compiler.zep index c2595fcca86..55aed71cd10 100644 --- a/phalcon/Mvc/View/Engine/Volt/Compiler.zep +++ b/phalcon/Mvc/View/Engine/Volt/Compiler.zep @@ -420,7 +420,9 @@ class Compiler implements InjectionAwareInterface { var expr, exprCode, lifetime; string compilation; - + /** + * @todo Remove this in the next major version + */ /** * A valid expression is required */ @@ -2759,14 +2761,6 @@ class Compiler implements InjectionAwareInterface break; - case PHVOLT_T_CACHE: - let compilation .= this->compileCache( - statement, - extendsMode - ); - - break; - case PHVOLT_T_DO: let compilation .= this->compileDo(statement); break; diff --git a/tests/integration/Mvc/View/Engine/Volt/Compiler/CompileStringCest.php b/tests/integration/Mvc/View/Engine/Volt/Compiler/CompileStringCest.php index ef4666dc8d4..162d87e29ae 100644 --- a/tests/integration/Mvc/View/Engine/Volt/Compiler/CompileStringCest.php +++ b/tests/integration/Mvc/View/Engine/Volt/Compiler/CompileStringCest.php @@ -505,30 +505,6 @@ private function getVoltCompileString(): array '{% set a = 1.2+1*(20/b) and c %}', '', ], - // Cache statement - [ - '{% cache somekey %} hello {% endcache %}', - 'di->get(\'viewCache\'); ' . - '$_cacheKey[$somekey] = $_cache[$somekey]->start($somekey); ' . - 'if ($_cacheKey[$somekey] === null) { ?> hello save($somekey); } ' . - 'else { echo $_cacheKey[$somekey]; } ?>', - ], - [ - '{% set lifetime = 500 %}{% cache somekey lifetime %} hello {% endcache %}', - '' . - 'di->get(\'viewCache\'); ' . - '$_cacheKey[$somekey] = $_cache[$somekey]->start($somekey, $lifetime); ' . - 'if ($_cacheKey[$somekey] === null) { ?> hello ' . - 'save($somekey, null, $lifetime); } else ' . - '{ echo $_cacheKey[$somekey]; } ?>', - ], - [ - '{% cache somekey 500 %} hello {% endcache %}', - 'di->get(\'viewCache\'); ' . - '$_cacheKey[$somekey] = $_cache[$somekey]->start($somekey, 500); ' . - 'if ($_cacheKey[$somekey] === null) { ?> hello ' . - 'save($somekey, null, 500); } else { echo $_cacheKey[$somekey]; } ?>', - ], //Autoescape mode [ '{{ "hello" }}{% autoescape true %}{{ "hello" }}{% autoescape false %}' .