Beispiel #1
0
 public static function init()
 {
     // create db connection
     // see if tmp directories exist - and create if not
     $dir = PathManager::smartyCompileDir();
     if (!file_exists($dir)) {
         mkdirfull($dir);
     }
     $dir = PathManager::smartyCacheDir();
     if (!file_exists($dir)) {
         mkdirfull($dir);
     }
     $dir = PathManager::smartyMacroTemplateDir();
     if (!file_exists($dir)) {
         mkdirfull($dir);
     }
     // connect to memcache server
     if (GlobalProperties::$USE_MEMCACHE == true) {
         self::$memcache = new Memcache();
         self::$memcache->connect(GlobalProperties::$MEMCACHE_HOST, GlobalProperties::$MEMCACHE_PORT);
         self::$memcache->setCompressThreshold(5000);
     } else {
         self::$memcache = new DummyMemcache();
     }
 }
Beispiel #2
0
 public function __construct()
 {
     $this->compiler_file = OZONE_ROOT . '/php/core/OzoneSmartyCompiler.php';
     $this->compiler_class = 'OzoneSmartyCompiler';
     $this->compile_dir = PathManager::smartyCompileDir();
     $this->cache_dir = PathManager::smartyCacheDir();
     $this->plugins_dir = array(PathManager::smartyPluginDir(), PathManager::smartyOzonePluginDir());
     //extra dir for application extensions
     $this->plugins_dir[] = WIKIDOT_ROOT . '/php/smarty_plugins/';
     $this->load_filter('pre', 'defmacrohelp');
     $this->assign("URL_HOST", GlobalProperties::$URL_HOST);
     $this->assign("URL_DOMAIN", GlobalProperties::$URL_DOMAIN);
     $this->assign("URL_DOCS", GlobalProperties::$URL_DOCS);
     $this->assign("IP_HOST", GlobalProperties::$IP_HOST);
     $this->assign("SERVICE_NAME", GlobalProperties::$SERVICE_NAME);
     $this->assign("SUPPORT_EMAIL", GlobalProperties::$SUPPORT_EMAIL);
 }