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.
|
continuing.
|
||||||
|
|
||||||
Two new API functions, assign_by_ref() and append_by_ref() were added. They
|
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
|
performance gain, especially if you are assigning large arrays of data. PHP 5.0
|
||||||
will do this implicitly, so these functions are basically workarounds.
|
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)
|
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;
|
return false;
|
||||||
|
|
||||||
if(!isset($auto_id) && !isset($auto_source)) {
|
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);
|
$tname = $this->_get_auto_filename($auto_base, $auto_source, $auto_id);
|
||||||
|
|
||||||
if(isset($auto_source)) {
|
if(isset($auto_source)) {
|
||||||
$res = @unlink($tname);
|
$res = $this->_unlink($tname);
|
||||||
} elseif ($this->use_sub_dirs) {
|
} elseif ($this->use_sub_dirs) {
|
||||||
$res = $this->_rmdir($tname, 1, $exp_time);
|
$res = $this->_rmdir($tname, 1, $exp_time);
|
||||||
} else {
|
} else {
|
||||||
@@ -1554,7 +1554,7 @@ function _run_insert_handler($args)
|
|||||||
|
|
||||||
while ($entry = readdir($handle)) {
|
while ($entry = readdir($handle)) {
|
||||||
if ($entry != '.' && $entry != '..') {
|
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);
|
$this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1583,10 +1583,10 @@ function _run_insert_handler($args)
|
|||||||
{
|
{
|
||||||
if(isset($exp_time)) {
|
if(isset($exp_time)) {
|
||||||
if(time() - filemtime($resource) >= $exp_time) {
|
if(time() - filemtime($resource) >= $exp_time) {
|
||||||
unlink($resource);
|
@unlink($resource);
|
||||||
}
|
}
|
||||||
} else {
|
} 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)
|
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;
|
return false;
|
||||||
|
|
||||||
if(!isset($auto_id) && !isset($auto_source)) {
|
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);
|
$tname = $this->_get_auto_filename($auto_base, $auto_source, $auto_id);
|
||||||
|
|
||||||
if(isset($auto_source)) {
|
if(isset($auto_source)) {
|
||||||
$res = @unlink($tname);
|
$res = $this->_unlink($tname);
|
||||||
} elseif ($this->use_sub_dirs) {
|
} elseif ($this->use_sub_dirs) {
|
||||||
$res = $this->_rmdir($tname, 1, $exp_time);
|
$res = $this->_rmdir($tname, 1, $exp_time);
|
||||||
} else {
|
} else {
|
||||||
@@ -1554,7 +1554,7 @@ function _run_insert_handler($args)
|
|||||||
|
|
||||||
while ($entry = readdir($handle)) {
|
while ($entry = readdir($handle)) {
|
||||||
if ($entry != '.' && $entry != '..') {
|
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);
|
$this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1583,10 +1583,10 @@ function _run_insert_handler($args)
|
|||||||
{
|
{
|
||||||
if(isset($exp_time)) {
|
if(isset($exp_time)) {
|
||||||
if(time() - filemtime($resource) >= $exp_time) {
|
if(time() - filemtime($resource) >= $exp_time) {
|
||||||
unlink($resource);
|
@unlink($resource);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unlink($resource);
|
@unlink($resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user