aboutsummaryrefslogtreecommitdiffstats
path: root/include/friendica_smarty.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2013-05-10 06:13:24 -0400
committerfabrixxm <fabrix.xm@gmail.com>2013-05-10 06:13:24 -0400
commitd4c07930d51244c8ae5014344c9502d010954448 (patch)
treed6e4815e0c895fdd00089a95a223456f6ba01756 /include/friendica_smarty.php
parente1c6b776c4c388b4671c0838c9d24feac42857c2 (diff)
downloadvolse-hubzilla-d4c07930d51244c8ae5014344c9502d010954448.tar.gz
volse-hubzilla-d4c07930d51244c8ae5014344c9502d010954448.tar.bz2
volse-hubzilla-d4c07930d51244c8ae5014344c9502d010954448.zip
add $db_port to .htconfig.php and $a->config['syste]['smarty3_folder'] for compiled templates
Diffstat (limited to 'include/friendica_smarty.php')
-rwxr-xr-xinclude/friendica_smarty.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/friendica_smarty.php b/include/friendica_smarty.php
index a4675acd4..ec0748600 100755
--- a/include/friendica_smarty.php
+++ b/include/friendica_smarty.php
@@ -21,9 +21,11 @@ class FriendicaSmarty extends Smarty {
$template_dirs = $template_dirs + array('base' => 'view/tpl/');
$this->setTemplateDir($template_dirs);
- $this->setCompileDir('view/tpl/smarty3/compiled/');
- $this->setConfigDir('view/tpl/smarty3/config/');
- $this->setCacheDir('view/tpl/smarty3/cache/');
+ $basecompiledir = $a->config['system']['smarty3_folder'];
+
+ $this->setCompileDir($basecompiledir.'/compiled/');
+ $this->setConfigDir($basecompiledir.'/config/');
+ $this->setCacheDir($basecompiledir.'/cache/');
$this->left_delimiter = $a->get_template_ldelim('smarty3');
$this->right_delimiter = $a->get_template_rdelim('smarty3');
@@ -46,9 +48,16 @@ class FriendicaSmartyEngine implements ITemplateEngine {
static $name ="smarty3";
public function __construct(){
- if(!is_writable('view/tpl/smarty3/')){
- echo "<b>ERROR:</b> folder <tt>view/tpl/smarty3/</tt> must be writable by webserver."; killme();
+ $a = get_app();
+ $basecompiledir = $a->config['system']['smarty3_folder'];
+ if (!$basecompiledir) $basecompiledir = dirname(__dir__)."/view/tpl/smarty3";
+ if (!is_dir($basecompiledir)) {
+ echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt>does not exixst."; killme();
+ }
+ if(!is_writable($basecompiledir)){
+ echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> must be writable by webserver."; killme();
}
+ $a->config['system']['smarty3_folder'] = $basecompiledir;
}
// ITemplateEngine interface