$backendOptions['hashed_directory_perm'
] =
octdec($backendOptions['hashed_directory_perm'
]);
} $this->_file_perms =
$backendOptions['cache_file_perm'
];
$this->_dir_perms =
$backendOptions['hashed_directory_perm'
];
// Set default dirs
$this->
setTemplateDir('.' . DS . 'templates' . DS
) ->
setCompileDir('.' . DS . 'templates_c' . DS
) ->
setPluginsDir([\
dirname(__FILE__
) . '/Plugins/', SMARTY_PLUGINS_DIR
]) ->
setCacheDir('.' . DS . 'cache' . DS
) ->
setConfigDir('.' . DS . 'configs' . DS
);
$this->debug_tpl = 'file:' . SMARTY_DIR . '/debug.tpl';
$this->
setOptions($options);
$this->
setCharset();
} /**
* Technically smarty security is enabled, if a security policy is set for the template manager instance. The
* security policy holds a reference to the template manager instance. When cloning the template manager, the
* reference of the security_policy to the Smarty instance has be updated to the new cloned Smarty instance.
*
* Without doing this, every self::fetch() after a directory was added with self::addTemplateDir(), would lead to a
* SmartyException with message 'directory [...] not allowed by security setting'. This is because
* the security_policy still holds a reference to the old Smarty instance that does not know this new directories
* as template sources.
*
* The security_policy is also cloned so other instances of the Enlight_Template_Manager do not get affected.
*/