mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
supress warnings from unlink() and is_dir(), let error handler deal with it
This commit is contained in:
@@ -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.
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user