Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing and bogus use lines in src/Smarty.php. #970

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix missing and bogus use lines in src/Smarty.php.
  • Loading branch information
wisskid committed Mar 27, 2024
commit 263c9cd3cdde3cd629750165884fc7f6116a3d2d
1 change: 1 addition & 0 deletions changelog/966.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966)
28 changes: 15 additions & 13 deletions src/Smarty.php
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

namespace Smarty;

use FilesystemIterator;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use Smarty\Cacheresource\File;
@@ -12,11 +13,12 @@
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
@@ -1337,7 +1339,7 @@ public function clearCompiledTemplate($resource_name = null, $compile_id = null,
}
$_filepath = (string)$_file;
if ($_file->isDir()) {
if (!$_compile->isDot()) {
if (!$_file->isDot()) {
// delete folder if empty
@rmdir($_file->getPathname());
}
@@ -1755,15 +1757,15 @@ public function getRuntime(string $type) {
// 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 @@ public function unregisterFilter($type, $name) {
* @param array|string $modifiers modifier or list of modifiers
* to add
*
* @return \Smarty|Template
* @return Smarty
* @api Smarty::addDefaultModifiers()
*
*/
@@ -2131,7 +2133,7 @@ public function fetch($template = null, $cache_id = null, $compile_id = null) {
* @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();
}

/**
Loading