Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 2 additions & 8 deletions src/Cacheresource/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ public function storeCachedContent(Template $_template, $content)
&& (!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);
Expand Down Expand Up @@ -223,10 +221,8 @@ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $e
$_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') {
Expand Down Expand Up @@ -279,8 +275,6 @@ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $e
&& (!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);
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -1344,10 +1344,8 @@ public function clearCompiledTemplate($resource_name = null, $compile_id = null,
}
$_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') {
Expand Down Expand Up @@ -1385,8 +1383,6 @@ public function clearCompiledTemplate($resource_name = null, $compile_id = null,
&& (!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);
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Template/Compiled.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ private function loadCompiledTemplate(Template $_smarty_tpl, bool $invalidateCac
&& (!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')) {
Expand Down
6 changes: 2 additions & 4 deletions tests/PHPUnit_Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,8 @@ public function cleanDir($dir)
}
// directory ?
if ($file->isDir()) {
if (!$ri->isDot()) {
// delete folder if empty
@rmdir($file->getPathname());
}
// delete folder if empty
@rmdir($file->getPathname());
} else {
unlink($file->getPathname());
}
Expand Down

This file was deleted.

This file was deleted.

73 changes: 0 additions & 73 deletions tests/UnitTests/__shared/cacheresources/cacheresource.apc.php

This file was deleted.