fix issue where cache dir does not exist

-This line, and those below, will be ignored--

M    distribution/libs/sysplugins/smarty_internal_cacheresource_file.php
This commit is contained in:
monte.ohrt
2014-07-24 15:08:32 +00:00
parent 071f9af42f
commit fcece85062

View File

@@ -147,7 +147,10 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
$_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
$_dir = realpath($smarty->getCacheDir()) . '/';
if (($_dir = realpath($smarty->getCacheDir())) === false) {
return 0;
}
$_dir .= '/';
$_dir_length = strlen($_dir);
if (isset($_cache_id)) {
$_cache_id_parts = explode('|', $_cache_id);