Esempio n. 1
0
 function Sugar_Smarty()
 {
     if (!file_exists(SUGAR_SMARTY_DIR)) {
         mkdir_recursive(SUGAR_SMARTY_DIR, true);
     }
     if (!file_exists(SUGAR_SMARTY_DIR . 'templates_c')) {
         mkdir_recursive(SUGAR_SMARTY_DIR . 'templates_c', true);
     }
     if (!file_exists(SUGAR_SMARTY_DIR . 'configs')) {
         mkdir_recursive(SUGAR_SMARTY_DIR . 'configs', true);
     }
     if (!file_exists(SUGAR_SMARTY_DIR . 'cache')) {
         mkdir_recursive(SUGAR_SMARTY_DIR . 'cache', true);
     }
     $this->template_dir = '.';
     $this->compile_dir = SUGAR_SMARTY_DIR . 'templates_c';
     $this->config_dir = SUGAR_SMARTY_DIR . 'configs';
     $this->cache_dir = SUGAR_SMARTY_DIR . 'cache';
     $this->request_use_auto_globals = true;
     // to disable Smarty from using long arrays
     // Smarty will create subdirectories under the compiled templates and cache directories
     $this->use_sub_dirs = true;
     if (empty(self::$_plugins_dir)) {
         self::$_plugins_dir = array();
         if (SugarAutoLoader::fileExists('custom/include/SugarSmarty/plugins')) {
             self::$_plugins_dir[] = 'custom/include/SugarSmarty/plugins';
         }
         if (SugarAutoLoader::fileExists('custom/vendor/Smarty/plugins')) {
             self::$_plugins_dir[] = 'custom/vendor/Smarty/plugins';
         }
         self::$_plugins_dir[] = 'include/SugarSmarty/plugins';
         self::$_plugins_dir[] = 'vendor/Smarty/plugins';
     }
     $this->plugins_dir = self::$_plugins_dir;
     $this->assign("VERSION_MARK", getVersionedPath(''));
 }