- fixed empty template error
| | |
| | | |
| | | |
| | | if($this->_cache && $this->_checkCache($tmplfile, $tmpl_from_string)) { //* cache exists so lets use it |
| | | $data = fread($fp = fopen($this->_cachefile, 'r'), filesize($this->_cachefile)); |
| | | fclose($fp); |
| | | $data = file_get_contents($this->_cachefile); |
| | | } else { //* no cache lets parse the file |
| | | if($tmpl_from_string == true) { |
| | | $data = $tmplfile; |
| | | } else { |
| | | $data = fread($fp = fopen($tmplfile, 'r'), filesize($tmplfile)); |
| | | fclose($fp); |
| | | $data = file_get_contents($tmplfile); |
| | | } |
| | | |
| | | $regex = '/(<|<\/|{|{\/|<!--|<!--\/){1}\s*'; |
| | |
| | | |
| | | |
| | | if($this->_cache && $this->_checkCache($tmplfile, $tmpl_from_string)) { //* cache exists so lets use it |
| | | $data = fread($fp = fopen($this->_cachefile, 'r'), filesize($this->_cachefile)); |
| | | fclose($fp); |
| | | $data = file_get_contents($this->_cachefile); |
| | | } else { //* no cache lets parse the file |
| | | if($tmpl_from_string == true) { |
| | | $data = $tmplfile; |
| | | } else { |
| | | $data = fread($fp = fopen($tmplfile, 'r'), filesize($tmplfile)); |
| | | fclose($fp); |
| | | $data = file_get_contents($tmplfile); |
| | | } |
| | | |
| | | $regex = '/(<|<\/|{|{\/|<!--|<!--\/){1}\s*'; |
| | |
| | | } |
| | | |
| | | // use vLib for template logic |
| | | if(trim($nginx_directives) != '') { |
| | | $nginx_directives_new = ''; |
| | | $ngx_conf_tpl = new tpl(); |
| | | $ngx_conf_tpl_tmp_file = tempnam($conf['temppath'], "ngx"); |
| | |
| | | if(is_file($ngx_conf_tpl_tmp_file)) unlink($ngx_conf_tpl_tmp_file); |
| | | if($nginx_directives_new != '') $nginx_directives = $nginx_directives_new; |
| | | unset($nginx_directives_new); |
| | | } |
| | | |
| | | // Make sure we only have Unix linebreaks |
| | | $nginx_directives = str_replace("\r\n", "\n", $nginx_directives); |