From 2256b443c9e8157614ef9167724f8c12d81e9400 Mon Sep 17 00:00:00 2001 From: mohrt Date: Thu, 8 Aug 2002 16:32:08 +0000 Subject: [PATCH] supress warnings from unlink() and is_dir(), let error handler deal with it --- RELEASE_NOTES | 2 +- Smarty.class.php | 10 +++++----- libs/Smarty.class.php | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 90720ee6..145f49ac 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -15,7 +15,7 @@ Plugins now stop execution upon error, instead of outputting a warning and continuing. Two new API functions, assign_by_ref() and append_by_ref() were added. They -allow assigning template variables by reference. This can make a significance +allow assigning template variables by reference. This can make a significant performance gain, especially if you are assigning large arrays of data. PHP 5.0 will do this implicitly, so these functions are basically workarounds. diff --git a/Smarty.class.php b/Smarty.class.php index f35d7e3e..f26d7509 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -1514,7 +1514,7 @@ function _run_insert_handler($args) \*======================================================================*/ function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) { - if (!is_dir($auto_base)) + if (!@is_dir($auto_base)) return false; if(!isset($auto_id) && !isset($auto_source)) { @@ -1523,7 +1523,7 @@ function _run_insert_handler($args) $tname = $this->_get_auto_filename($auto_base, $auto_source, $auto_id); if(isset($auto_source)) { - $res = @unlink($tname); + $res = $this->_unlink($tname); } elseif ($this->use_sub_dirs) { $res = $this->_rmdir($tname, 1, $exp_time); } else { @@ -1554,7 +1554,7 @@ function _run_insert_handler($args) while ($entry = readdir($handle)) { if ($entry != '.' && $entry != '..') { - if (is_dir($dirname . DIR_SEP . $entry)) { + if (@is_dir($dirname . DIR_SEP . $entry)) { $this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time); } else { @@ -1583,10 +1583,10 @@ function _run_insert_handler($args) { if(isset($exp_time)) { if(time() - filemtime($resource) >= $exp_time) { - unlink($resource); + @unlink($resource); } } else { - unlink($resource); + @unlink($resource); } } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index f35d7e3e..f26d7509 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1514,7 +1514,7 @@ function _run_insert_handler($args) \*======================================================================*/ function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) { - if (!is_dir($auto_base)) + if (!@is_dir($auto_base)) return false; if(!isset($auto_id) && !isset($auto_source)) { @@ -1523,7 +1523,7 @@ function _run_insert_handler($args) $tname = $this->_get_auto_filename($auto_base, $auto_source, $auto_id); if(isset($auto_source)) { - $res = @unlink($tname); + $res = $this->_unlink($tname); } elseif ($this->use_sub_dirs) { $res = $this->_rmdir($tname, 1, $exp_time); } else { @@ -1554,7 +1554,7 @@ function _run_insert_handler($args) while ($entry = readdir($handle)) { if ($entry != '.' && $entry != '..') { - if (is_dir($dirname . DIR_SEP . $entry)) { + if (@is_dir($dirname . DIR_SEP . $entry)) { $this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time); } else { @@ -1583,10 +1583,10 @@ function _run_insert_handler($args) { if(isset($exp_time)) { if(time() - filemtime($resource) >= $exp_time) { - unlink($resource); + @unlink($resource); } } else { - unlink($resource); + @unlink($resource); } }