diff options
| author | hirosan <h-marumoto@cybozu.co.jp> | 2026-01-08 19:21:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-08 11:21:57 +0100 |
| commit | 6709d000cd08e4e1fdba4944c7d18275d2a0a2f1 (patch) | |
| tree | eb758fff6f4e7a73241de1fcfcc86e8e924a9d2b /src | |
| parent | aa6edc3c0bf8fc77cda9a06320021328c924cd68 (diff) | |
| download | smarty-6709d000cd08e4e1fdba4944c7d18275d2a0a2f1.tar.gz smarty-6709d000cd08e4e1fdba4944c7d18275d2a0a2f1.tar.bz2 smarty-6709d000cd08e4e1fdba4944c7d18275d2a0a2f1.zip | |
Fix static analysis warnings for isDot() and remove deprecated APC support (#1164)
* Fix static analysis warnings for isDot()
* Remove deprecated APC support
* Remove redundant isDot() check and fix static analysis warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/Cacheresource/File.php | 10 | ||||
| -rw-r--r-- | src/Smarty.php | 8 | ||||
| -rw-r--r-- | src/Template/Compiled.php | 2 |
3 files changed, 4 insertions, 16 deletions
diff --git a/src/Cacheresource/File.php b/src/Cacheresource/File.php index 4b4198ec..3cb09b5e 100644 --- a/src/Cacheresource/File.php +++ b/src/Cacheresource/File.php @@ -127,8 +127,6 @@ class File extends Base && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api'))) < 1 ) { opcache_invalidate($_template->getCached()->filepath, true); - } elseif (function_exists('apc_compile_file')) { - apc_compile_file($_template->getCached()->filepath); } $cached = $_template->getCached(); $cached->timestamp = $cached->exists = is_file($cached->filepath); @@ -223,10 +221,8 @@ class File extends Base $_filepath = (string)$_file; // directory ? if ($_file->isDir()) { - if (!$_cache->isDot()) { - // delete folder if empty - @rmdir($_file->getPathname()); - } + // delete folder if empty + @rmdir($_file->getPathname()); } else { // delete only php files if (substr($_filepath, -4) !== '.php') { @@ -279,8 +275,6 @@ class File extends Base && (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api")) < 1) ) { opcache_invalidate($_filepath, true); - } elseif (function_exists('apc_delete_file')) { - apc_delete_file($_filepath); } } } diff --git a/src/Smarty.php b/src/Smarty.php index b53a36c2..73df97ed 100644 --- a/src/Smarty.php +++ b/src/Smarty.php @@ -1344,10 +1344,8 @@ class Smarty extends \Smarty\TemplateBase { } $_filepath = (string)$_file; if ($_file->isDir()) { - if (!$_compile->isDot()) { - // delete folder if empty - @rmdir($_file->getPathname()); - } + // delete folder if empty + @rmdir($_file->getPathname()); } else { // delete only php files if (substr($_filepath, -4) !== '.php') { @@ -1385,8 +1383,6 @@ class Smarty extends \Smarty\TemplateBase { && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1) ) { opcache_invalidate($_filepath, true); - } elseif (function_exists('apc_delete_file')) { - apc_delete_file($_filepath); } } } diff --git a/src/Template/Compiled.php b/src/Template/Compiled.php index 5a07db0e..e5e2aec7 100644 --- a/src/Template/Compiled.php +++ b/src/Template/Compiled.php @@ -251,8 +251,6 @@ class Compiled extends GeneratedPhpFile { && (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api")) < 1) ) { opcache_invalidate($this->filepath, true); - } elseif (function_exists('apc_compile_file')) { - apc_compile_file($this->filepath); } } if (defined('HHVM_VERSION')) { |
