PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_resource_file.php
Go to the documentation of this file.
1 <?php
20 
27  public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
28  {
29  $source->filepath = $this->buildFilepath($source, $_template);
30 
31  if ($source->filepath !== false) {
32  if (is_object($source->smarty->security_policy)) {
33  $source->smarty->security_policy->isTrustedResourceDir($source->filepath);
34  }
35 
36  $source->uid = sha1($source->filepath);
37  if ($source->smarty->compile_check && !isset($source->timestamp)) {
38  $source->timestamp = @filemtime($source->filepath);
39  $source->exists = !!$source->timestamp;
40  }
41  }
42  }
43 
49  public function populateTimestamp(Smarty_Template_Source $source)
50  {
51  $source->timestamp = @filemtime($source->filepath);
52  $source->exists = !!$source->timestamp;
53  }
54 
62  public function getContent(Smarty_Template_Source $source)
63  {
64  if ($source->timestamp) {
65  return file_get_contents($source->filepath);
66  }
67  if ($source instanceof Smarty_Config_Source) {
68  throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
69  }
70  throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
71  }
72 
79  public function getBasename(Smarty_Template_Source $source)
80  {
81  $_file = $source->name;
82  if (($_pos = strpos($_file, ']')) !== false) {
83  $_file = substr($_file, $_pos + 1);
84  }
85  return basename($_file);
86  }
87 
88 }
89 
90 ?>
getBasename(Smarty_Template_Source $source)
Determine basename for compiled filename.
populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
populate Source Object with meta data from Resource
getContent(Smarty_Template_Source $source)
Load template's source from file into current template object.
buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
build template filepath by traversing the template_dir array
populateTimestamp(Smarty_Template_Source $source)
populate Source Object with timestamp and exists from Resource

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:17 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.