PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_resource_stream.php
Go to the documentation of this file.
1 <?php
23 
31  public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
32  {
33  if(strpos($source->resource, '://') !== false) {
34  $source->filepath = $source->resource;
35  } else {
36  $source->filepath = str_replace(':', '://', $source->resource);
37  }
38  $source->uid = false;
39  $source->content = $this->getContent($source);
40  $source->timestamp = false;
41  $source->exists = !!$source->content;
42  }
43 
51  public function getContent(Smarty_Template_Source $source)
52  {
53  $t = '';
54  // the availability of the stream has already been checked in Smarty_Resource::fetch()
55  $fp = fopen($source->filepath, 'r+');
56  if ($fp) {
57  while (!feof($fp) && ($current_line = fgets($fp)) !== false) {
58  $t .= $current_line;
59  }
60  fclose($fp);
61  return $t;
62  } else {
63  return false;
64  }
65  }
66 
74  protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
75  {
76  return get_class($this) . '#' . $resource_name;
77  }
78 }
getContent(Smarty_Template_Source $source)
Load template's source from stream into current template object.
Smarty plugin to format text blocks.
populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
populate Source Object with meta data from Resource
buildUniqueResourceName(Smarty $smarty, $resource_name)
modify resource_name according to resource handlers specifications

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.