libs/sysplugins/smarty_resource_custom.php Quellcode

smarty_resource_custom.php
gehe zur Dokumentation dieser Datei
1 <?php
18 {
26  abstract protected function fetch($name, &$source, &$mtime);
27 
37  protected function fetchTimestamp($name)
38  {
39  return null;
40  }
41 
48  public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
49  {
50  $source->filepath = $source->type . ':' . $source->name;
51  $source->uid = sha1($source->type . ':' . $source->name);
52 
53  $mtime = $this->fetchTimestamp($source->name);
54  if ($mtime !== null) {
55  $source->timestamp = $mtime;
56  } else {
57  $this->fetch($source->name, $content, $timestamp);
58  $source->timestamp = isset($timestamp) ? $timestamp : false;
59  if (isset($content)) {
60  $source->content = $content;
61  }
62  }
63  $source->exists = !!$source->timestamp;
64  }
65 
74  public function getContent(Smarty_Template_Source $source)
75  {
76  $this->fetch($source->name, $content, $timestamp);
77  if (isset($content)) {
78  return $content;
79  }
80 
81  throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
82  }
83 
91  public function getBasename(Smarty_Template_Source $source)
92  {
93  return basename($source->name);
94  }
95 }




Korrekturen, Hinweise und Ergänzungen

Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.