示例#1
0
 public function __construct($tpl = '')
 {
     parent::__construct($tpl);
     require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php';
     //
     $this->smarty = new \Smarty();
     $this->smarty->compile_dir = defined('PATH_SMARTY_C') ? PATH_SMARTY_C : sys_get_temp_dir();
     $this->smarty->cache_dir = defined('PATH_SMARTY_CACHE') ? PATH_SMARTY_CACHE : sys_get_temp_dir();
     if (!is_dir($this->smarty->compile_dir)) {
         Common::mk_dir($this->smarty->compile_dir);
     }
     if (!is_dir($this->smarty->cache_dir)) {
         Common::mk_dir($this->smarty->cache_dir);
     }
 }
 public function getApiVersion()
 {
     try {
         $arrayConfig = array();
         //$apiIniFile - Contains file name of api ini configuration
         $apiIniFile = $this->workflowDir . "engine" . DS . "src" . DS . "ProcessMaker" . DS . "Services" . DS . "api.ini";
         if (file_exists($apiIniFile)) {
             $arrayConfig = Util\Common::parseIniFile($apiIniFile);
         }
         return isset($arrayConfig["api"]["version"]) ? $arrayConfig["api"]["version"] : "1.0";
     } catch (\Exception $e) {
         throw $e;
     }
 }