- removed internal muteExpectedErrors() calls in favor of having the implementor call this once from his application

- optimized muteExpectedErrors() to pass errors to the latest registered error handler, if appliccable

error muting is now a global thing. this was done because of the overhead set_error_handler imposes and the fact, that only a few people really "need" this. 

The decision was made by uwe.tews and rodneyrehm. (just in case anyone asks…)
This commit is contained in:
rodneyrehm
2011-09-24 12:56:52 +00:00
parent 537285032c
commit d0228e96ea
7 changed files with 34 additions and 40 deletions
@@ -61,9 +61,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
$cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
}
$cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
Smarty::muteExpectedErrors();
$cached->timestamp = @filemtime($cached->filepath);
Smarty::unmuteExpectedErrors();
$cached->exists = !!$cached->timestamp;
}
@@ -75,9 +73,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
*/
public function populateTimestamp(Smarty_Template_Cached $cached)
{
Smarty::muteExpectedErrors();
$cached->timestamp = @filemtime($cached->filepath);
Smarty::unmuteExpectedErrors();
$cached->exists = !!$cached->timestamp;
}
@@ -227,9 +223,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
} else {
clearstatcache();
}
Smarty::muteExpectedErrors();
$t = @filemtime($cached->lock_id);
Smarty::unmuteExpectedErrors();
return $t && (time() - $t < $smarty->locking_timeout);
}