aboutsummaryrefslogtreecommitdiffstats
path: root/include/friendica_smarty.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-05-10 03:32:42 -0700
committerfriendica <info@friendica.com>2013-05-10 03:32:42 -0700
commitc6662e35749eaf0c8db00e6a5090f866a370252c (patch)
treed6e4815e0c895fdd00089a95a223456f6ba01756 /include/friendica_smarty.php
parente1c6b776c4c388b4671c0838c9d24feac42857c2 (diff)
parentd4c07930d51244c8ae5014344c9502d010954448 (diff)
downloadvolse-hubzilla-c6662e35749eaf0c8db00e6a5090f866a370252c.tar.gz
volse-hubzilla-c6662e35749eaf0c8db00e6a5090f866a370252c.tar.bz2
volse-hubzilla-c6662e35749eaf0c8db00e6a5090f866a370252c.zip
Merge pull request #51 from fabrixxm/settings
add some settings:
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