[Templating] changed filesystem loader to only logged failed paths when not able to load the template

This commit is contained in:
Fabien Potencier 2010-01-29 21:53:29 +01:00
parent d372ae8efe
commit e1aae4b820
1 changed files with 7 additions and 1 deletions

View File

@ -66,6 +66,7 @@ class FilesystemLoader extends Loader
$replacements['%'.$key.'%'] = $value;
}
$logs = array();
foreach ($this->templatePathPatterns as $templatePathPattern)
{
if (is_file($file = strtr($templatePathPattern, $replacements)))
@ -80,10 +81,15 @@ class FilesystemLoader extends Loader
if ($this->debugger)
{
$this->debugger->log(sprintf('Failed loading template file "%s" (renderer: %s)', $file, $options['renderer']));
$logs[] = sprintf('Failed loading template file "%s" (renderer: %s)', $file, $options['renderer']);
}
}
foreach ($logs as $log)
{
$this->debugger->log($log);
}
return false;
}