mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-03 19:30:49 +02:00
- 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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user