diff options
| author | Simon Wisselink <wisskid@users.noreply.github.com> | 2024-03-27 22:53:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-27 22:53:03 +0100 |
| commit | cafe5e1e59f3306fa4b05663b6292d1fc0865cad (patch) | |
| tree | b1cef1ff5f233848af42fb1f070ef2def2abfe62 | |
| parent | a58d869502e270bc7d02d245f5e2022937a398aa (diff) | |
| download | smarty-cafe5e1e59f3306fa4b05663b6292d1fc0865cad.tar.gz smarty-cafe5e1e59f3306fa4b05663b6292d1fc0865cad.tar.bz2 smarty-cafe5e1e59f3306fa4b05663b6292d1fc0865cad.zip | |
Fix missing and bogus use lines in src/Smarty.php. (#970)
| -rw-r--r-- | changelog/966.md | 1 | ||||
| -rw-r--r-- | src/Smarty.php | 26 |
2 files changed, 15 insertions, 12 deletions
diff --git a/changelog/966.md b/changelog/966.md new file mode 100644 index 00000000..5332ce59 --- /dev/null +++ b/changelog/966.md @@ -0,0 +1 @@ +- Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966)
\ No newline at end of file diff --git a/src/Smarty.php b/src/Smarty.php index 6925d406..0f6ee0ce 100644 --- a/src/Smarty.php +++ b/src/Smarty.php @@ -2,6 +2,7 @@ namespace Smarty; +use FilesystemIterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use Smarty\Cacheresource\File; @@ -12,11 +13,12 @@ use Smarty\Extension\CoreExtension; use Smarty\Extension\DefaultExtension; use Smarty\Extension\ExtensionInterface; use Smarty\Filter\Output\TrimWhitespace; -use Smarty\Resource\BasePlugin; -use Smarty\Smarty\Runtime\CaptureRuntime; -use Smarty\Smarty\Runtime\ForeachRuntime; -use Smarty\Smarty\Runtime\InheritanceRuntime; -use Smarty\Smarty\Runtime\TplFunctionRuntime; +use Smarty\Runtime\CaptureRuntime; +use Smarty\Runtime\DefaultPluginHandlerRuntime; +use Smarty\Runtime\ForeachRuntime; +use Smarty\Runtime\InheritanceRuntime; +use Smarty\Runtime\TplFunctionRuntime; + /** * Project: Smarty: the PHP compiling template engine @@ -1755,15 +1757,15 @@ class Smarty extends \Smarty\TemplateBase { // Lazy load runtimes when/if needed switch ($type) { case 'Capture': - return $this->runtimes[$type] = new \Smarty\Runtime\CaptureRuntime(); + return $this->runtimes[$type] = new CaptureRuntime(); case 'Foreach': - return $this->runtimes[$type] = new \Smarty\Runtime\ForeachRuntime(); + return $this->runtimes[$type] = new ForeachRuntime(); case 'Inheritance': - return $this->runtimes[$type] = new \Smarty\Runtime\InheritanceRuntime(); + return $this->runtimes[$type] = new InheritanceRuntime(); case 'TplFunction': - return $this->runtimes[$type] = new \Smarty\Runtime\TplFunctionRuntime(); + return $this->runtimes[$type] = new TplFunctionRuntime(); case 'DefaultPluginHandler': - return $this->runtimes[$type] = new \Smarty\Runtime\DefaultPluginHandlerRuntime( + return $this->runtimes[$type] = new DefaultPluginHandlerRuntime( $this->getDefaultPluginHandlerFunc() ); } @@ -2052,7 +2054,7 @@ class Smarty extends \Smarty\TemplateBase { * @param array|string $modifiers modifier or list of modifiers * to add * - * @return \Smarty|Template + * @return Smarty * @api Smarty::addDefaultModifiers() * */ @@ -2131,7 +2133,7 @@ class Smarty extends \Smarty\TemplateBase { * @throws \Smarty\Exception */ public function display($template = null, $cache_id = null, $compile_id = null) { - return $this->returnOrCreateTemplate($template, $cache_id, $compile_id)->display(); + $this->returnOrCreateTemplate($template, $cache_id, $compile_id)->display(); } /** |
