5 * Resource Implementation modifying the extends-Resource to walk
6 * through the template_dirs and inherit all templates of the same name
8 * @package Resource-examples
11 class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
14 * populate Source Object with meta data from Resource
16 * @param Smarty_Template_Source $source source object
17 * @param Smarty_Internal_Template $_template template object
21 public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
26 foreach ($source->smarty->getTemplateDir() as $key => $directory) {
28 $s = Smarty_Resource::source(null, $source->smarty, 'file:' . '[' . $key . ']' . $source->name);
32 $sources[ $s->uid ] = $s;
34 $timestamp = $s->timestamp > $timestamp ? $s->timestamp : $timestamp;
36 catch (SmartyException $e) {
40 $source->exists = false;
44 $sources = array_reverse($sources, true);
46 $s = current($sources);
47 $source->components = $sources;
48 $source->filepath = $s->filepath;
49 $source->uid = sha1($uid . $source->smarty->_joined_template_dir);
50 $source->exists = true;
51 $source->timestamp = $timestamp;
55 * Disable timestamp checks for extendsall resource.
56 * The individual source components will be checked.
60 public function checkTimestamps()