Browse Source

U Ant route

Piotr Labudda 6 years ago
parent
commit
673e2dd42d
3 changed files with 254 additions and 223 deletions
  1. 246 221
      SE/se-lib/Route/Ant.php
  2. 3 2
      SE/se-lib/Route/UrlAction/Ant.php
  3. 5 0
      SE/se-lib/V.php

+ 246 - 221
SE/se-lib/Route/Ant.php

@@ -21,230 +21,255 @@ Lib::loadClass('DBG');
  */
 class Route_Ant extends RouteBase {
 
-  public $pathTools;
-  public $pathUrlActions;
-  public $antBin;
-  public $_antUrlProjects;
-  public $_antUrlProjectTemplates;
-
-  public function __construct() {
-    $this->pathTools = APP_PATH_SCHEMA . "/ant-tool/";
-    $this->pathUrlActions = APP_PATH_SCHEMA . "/ant-url_action/";
-    $this->antBin = APP_PATH_WWW . DS . 'stuff' . DS . 'dita-ot-2.3.3' . DS . 'bin' . DS . 'ant';
-    $this->_antUrlProjects = [];// path => label
-    $this->_antUrlProjectTemplates = [];// path => [ template => label ]
-  }
-
-  public function defaultAction() {
-    UI::gora();
-    UI::tag('h1', [], 'Ant');
-    try {
-      $taskList = $this->getAntToolList();
-      DBG::nicePrint($taskList, 'ant-tool');
-
-      $featureID = V::get('featureID', '', $_GET);
-      $namespace = V::get('namespace', '', $_GET);
-
-      UI::startTag('ul');
-      foreach ($taskList as $path => $label) {
-        $link = "index.php?_route=Ant&_task=ant&path={$path}";
-        echo UI::h('li', [], [
-          UI::h('a', ['href'=>$link], "Uruchom '{$label}'")
-        ]);
-      }
-      UI::endTag('ul');
-    } catch (Exception $e) {
-      UI::alert('danger', $e->getMessage());
-      DBG::log($e);
-    }
-    UI::dol();
-  }
-
-  public function antAction() {
-    UI::gora();
-    try {
-      $path = V::get('path', '', $_GET);
-      if (!$path) throw new Exception("Missing Ant path!");
-      $taskList = $this->getAntToolList();
-      if (!array_key_exists($path, $taskList)) throw new Exception("Ant path not exists! '{$path}'");
-
-      $cmd = "cd {$this->pathTools}{$path} && {$this->antBin} -Xms5g -Xmx11g 2>&1";// wymaga java jdk
-      V::exec($cmd, $out, $ret);
-    } catch (Exception $e) {
-      UI::alert('danger', $e->getMessage());
-      DBG::log($e);
-    }
-    UI::dol();
-  }
-
-  public function execAntTool($antTask) {
-    $antList = $this->getAntToolList();
-    if (!array_key_exists($antTask, $antList)) throw new Exception("ant task not found", 404);
-    throw new Exception("TODO: run ant task '{$antTask}'", 501);
-  }
-
- //todo headery xml itp - aby szly z anta do tej funkcji i wysylane byly przez php
-  // /SE/ant.php?antTask=$ jakas nazwa z ant_tool
-  //ant ogolne
-  //
-
-  public function getAntUrlActionList() {
-    if (!empty($this->_antUrlProjects)) return $this->_antUrlProjects;
-    V::exec("ls -1 {$this->pathUrlActions}*/*/build.xml", $out, $ret);
-    $this->_antUrlProjects = array();
-    foreach ($out as $line) {
-      try {
-        if ($this->pathUrlActions != substr($line, 0, strlen($this->pathUrlActions))) throw new Exception("Wrong line prefix '{$line}' - skip");
-        if ('/build.xml' != substr($line, -1 * strlen('/build.xml'))) throw new Exception("Wrong line suffix '{$line}' - expected '/build.xml' - skip");
-      } catch (Exception $e) {
-        UI::alert('warning', $e->getMessage());
-        continue;
-      }
-      $line = substr($line, strlen($this->pathUrlActions));
-      $path = substr($line, 0, -1 * strlen('/build.xml'));
-      $this->_antUrlProjects[$path] = $path;
-      try {
-        V::exec("cd {$this->pathUrlActions}/{$path} && ant -p|grep -v '^Unable to locate'|grep -v '^Buildfile:'", $out, $ret);
-        // Test WFS for actions given featureID   // TODO: first line - project description
-        // Main targets:
-        //
-        //  DescribeFeatureType  URL_TASK Target DescribeFeatureType
-        //  GetFeature           URL_TASK Target GetFeature
-        // Default target: http_first_input
-        if (!empty($out)) {
-          $projectDesc = '';
-          $templates = [];
-          $state = 'projectDesc';// 'projectDesc', 'Main targets', 'Default target'
-          foreach ($out as $line) {
-            switch ($state) {
-              case 'projectDesc': {
-                if ('Main targets' == substr($line, 0, strlen('Main targets'))) {
-                  $state = 'Main targets';
-                } else {
-                  $line = trim($line);
-                  if (!$projectDesc && $line) $projectDesc = $line;
-                }
-              } break;
-              case 'Main targets': {
-                if (false !== ($pos = strpos($line, 'URL_TASK'))) {
-                  $templateName = trim(substr($line, 0, $pos));
-                  $label = trim(substr($line, $pos + 9));
-                  if (!empty($templateName)) $templates[$templateName] = (!empty($label)) ? $label : $templateName;
-                }
-                if ('Default target' == substr($line, 0, strlen('Default target'))) {
-                  $state = 'Default target';
-                }
-              } break;
-            }
-          }
-          if (!empty($projectDesc)) $this->_antUrlProjects[$path] = $projectDesc;
-          if (!empty($templates)) foreach ($templates as $t => $l) $this->_antUrlProjectTemplates[$path][$t] = $l;
-        }
-      } catch (Exception $e) {
-        DBG::log($e);
-      }
-    }
-    DBG::log((array)$this, 'array', "Ant projects and main targets");
-    return $this->_antUrlProjects;
-  }
-  public function getAntUrlActionTemplates($path) {
-    if (!empty($this->_antUrlProjectTemplates[$path])) return $this->_antUrlProjectTemplates[$path];
-    $this->getAntUrlActionList();
-    if (!empty($this->_antUrlProjectTemplates[$path])) return $this->_antUrlProjectTemplates[$path];
-  }
-  public function getAntToolList() {
-    V::exec("ls -1 {$this->pathTools}*/build.xml", $out, $ret);
-    $taskList = array();
-    foreach ($out as $line) {
-      try {
-        if ($this->pathTools != substr($line, 0, strlen($this->pathTools))) throw new Exception("Wrong line prefix '{$line}' - skip");
-        if ('/build.xml' != substr($line, -1 * strlen('/build.xml'))) throw new Exception("Wrong line suffix '{$line}' - expected '/build.xml' - skip");
-      } catch (Exception $e) {
-        UI::alert('warning', $e->getMessage());
-        continue;
-      }
-      $line = substr($line, strlen($this->pathTools));
-      $name = substr($line, 0, -1 * strlen('/build.xml'));
-      $taskList[$name] = $name;// TODO: $name => $description (read from build.xml file first xml tag <project...>)
-    }
-    return $taskList;
-  }
-
-  public function generatePdfAction() {// TODO: OLD TEST
-    $antPath = V::get('ditaPath', '', $_GET);
-    $idKoresp = V::get('idKoresp', 0, $_POST, 'int');
-    $doExecute = V::get('doExecute', '', $_POST);
-
-    $antList = $this->getAntToolList();
-    if (!array_key_exists($antPath, $antList)) throw new Exception("dita path not found", 404);
-
-    UI::gora();
-    UI::startContainer();
-    try {
-      UI::tag('h1', [], "Dita: '{$antList[$antPath]}'");
-
-      UI::startTag('form', ['action'=>"", 'method'=>"POST", 'class'=>'form-inline']);
-      UI::tag('input', ['type'=>'number', 'value'=>$idKoresp, 'class'=>'form-control', 'style'=>'max-width:200px']);
-      UI::tag('input', ['type'=>'hidden', 'name'=>'doExecute', 'value'=>'1']);
-      UI::tag('input', ['type'=>"submit", 'value'=>"Wykonaj", 'class'=>'btn btn-primary']);
-      UI::endTag('form');
-
-      if ($doExecute) {
-        // if ($idKoresp <= 0) throw new Exception("Bad Request - missing id koresp");
-        if ($idKoresp <= 0) UI::alert('danger', "Missing id koresp - using default file");
-        if ($idKoresp > 0) UI::alert('warning', "TODO: generate xml file for id koresp = {$idKoresp}");
-
-        $execPath = APP_PATH_SCHEMA . DS . 'ant' . DS . $antPath;
-        $ant = APP_PATH_WWW . DS . 'stuff' . DS . 'dita-ot-2.3.3' . DS . 'bin' . DS . 'ant';
-        $cmd = "cd {$execPath} && {$ant} 2>&1";// wymaga java jdk
-        V::exec($cmd, $out, $ret);
-        DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
-      }
-
-      throw new Exception("TODO: F." . __FUNCTION__ . " . L." . __LINE__);
-    } catch (Exception $e) {
-      UI::alert('danger', $e->getMessage());
-    }
-    UI::endContainer();
-    UI::dol();
-  }
-
-  public function reinstallAction() {
-    UI::gora();
-    UI::tag('h1', [], 'Reinstall Dita Open Toolkit 2.3.3');
-    $stuffPath = APP_PATH_WWW . DS . 'stuff';
-    // $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && rm dita-ot-2.3.3.zip || echo PASSED";
-  	// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && wget https://github.com/dita-ot/dita-ot/releases/download/2.3.3/dita-ot-2.3.3.zip -O dita-ot-2.3.3.zip ";
-  	// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && rm dita-ot-2.3.3 || echo PASSED";
-  	// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && unzip dita-ot-2.3.3.zip || echo PASSED";
-  	// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3 && ./startcmd.sh || echo PASSED";
-    $wget = "/opt/local/bin/wget";
-    $unzip = "/usr/bin/unzip";
-
-    // $testCmd = "which unzip";
-    // V::exec($testCmd, $out, $ret);
-    // DBG::_(true, true, "testCmd: {$testCmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
-
-    // $testCmd = "which wget";
-    // V::exec($testCmd, $out, $ret);
-    // DBG::_(true, true, "testCmd: {$testCmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
-
-    $cmd = "cd {$stuffPath} ; [ -f dita-ot-2.3.3.zip ] && rm dita-ot-2.3.3.zip";
-    V::exec($cmd, $out, $ret);
-    DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
-
-    $cmd = "cd {$stuffPath} ; {$wget} https://github.com/dita-ot/dita-ot/releases/download/2.3.3/dita-ot-2.3.3.zip -O dita-ot-2.3.3.zip";
-    V::exec($cmd, $out, $ret);
-    DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
-
-    $cmd = "cd {$stuffPath}
+	public $pathTools;
+	public $pathUrlActions;
+	public $antBin;
+	public $_antUrlProjects;
+	public $_antUrlProjectTemplates;
+
+	public function __construct() {
+		$this->pathTools = APP_PATH_SCHEMA . "/ant-tool/";
+		$this->pathUrlActions = APP_PATH_SCHEMA . "/ant-url_action";
+		$this->antBin = APP_PATH_WWW . DS . 'stuff' . DS . 'dita-ot-2.3.3' . DS . 'bin' . DS . 'ant';
+		$this->_antUrlProjects = [];// path => label
+		$this->_antUrlProjectTemplates = [];// path => [ template => label ]
+	}
+
+	public function defaultAction() {
+		UI::gora();
+		UI::tag('h1', [], 'Ant');
+		try {
+			$taskList = $this->getAntToolList();
+			DBG::nicePrint($taskList, 'ant-tool');
+
+			$featureID = V::get('featureID', '', $_GET);
+			$namespace = V::get('namespace', '', $_GET);
+
+			UI::startTag('ul');
+			foreach ($taskList as $path => $label) {
+				$link = "index.php?_route=Ant&_task=ant&path={$path}";
+				echo UI::h('li', [], [
+					UI::h('a', ['href'=>$link], "Uruchom '{$label}'")
+				]);
+			}
+			UI::endTag('ul');
+		} catch (Exception $e) {
+			UI::alert('danger', $e->getMessage());
+			DBG::log($e);
+		}
+		UI::dol();
+	}
+
+	public function antAction() {
+		UI::gora();
+		try {
+			$path = V::get('path', '', $_GET);
+			if (!$path) throw new Exception("Missing Ant path!");
+			$taskList = $this->getAntToolList();
+			if (!array_key_exists($path, $taskList)) throw new Exception("Ant path not exists! '{$path}'");
+
+			$cmd = "cd {$this->pathTools}{$path} && {$this->antBin} -Xms5g -Xmx11g 2>&1";// wymaga java jdk
+			V::exec($cmd, $out, $ret);
+		} catch (Exception $e) {
+			UI::alert('danger', $e->getMessage());
+			DBG::log($e);
+		}
+		UI::dol();
+	}
+
+	public function execAntTool($antTask) {
+		$antList = $this->getAntToolList();
+		if (!array_key_exists($antTask, $antList)) throw new Exception("ant task not found", 404);
+		throw new Exception("TODO: run ant task '{$antTask}'", 501);
+	}
+
+	//todo headery xml itp - aby szly z anta do tej funkcji i wysylane byly przez php
+	// /SE/ant.php?antTask=$ jakas nazwa z ant_tool
+	//ant ogolne
+
+	public function getAntUrlActionList() {
+		if (!empty($this->_antUrlProjects)) return $this->_antUrlProjects;
+		DBG::log("DBG::getAntUrlActionList START");
+		V::exec("ls -1 {$this->pathUrlActions}/*/*/build.xml", $out, $ret);
+		DBG::log($out, 'array', "DBG::getAntUrlActionList ls -1 */*/build.xml ret({$ret})");
+		if (0) { // tmp use glob to store filemtime($file)
+			$antFileList = glob("{$this->pathUrlActions}/*/*/build.xml", GLOB_NOSORT);
+			DBG::log($antFileList, 'array', "DBG::getAntUrlActionList glob */*/build.xml");
+
+			// tmp use glob to store filemtime($file)
+			$antFileList = V::glob("{$this->pathUrlActions}/*/*/build.xml", GLOB_NOSORT);
+			$pathUrlActions = $this->pathUrlActions;
+			DBG::log($pathUrlActions, 'array', "DBG::getAntUrlActionList pathUrlActions");
+			$antMtimeFileList = array_map(function ($filePath) use ($pathUrlActions) {
+				// $pathUrlActions = '/Users/plabudda/rsync.se.master/SE/schema/ant-url_action'
+				// 0 => '/Users/plabudda/rsync.se.master/SE/schema/ant-url_action/default_db.in7_dziennik_koresp/etykieta/build.xml',
+				// 0 => 'default_db.in7_dziennik_koresp/etykieta/build.xml',
+				list($ns, $folderName, $buildXml) = explode('/', str_replace($pathUrlActions . '/', '', $filePath));
+				return [
+					'ns' => $ns,
+					'folderName' => $folderName,
+					'mtime' => filemtime($filePath),
+				];
+			}, $antFileList);
+			DBG::log($antMtimeFileList, 'array', "DBG::getAntUrlActionList glob + mtime");
+
+			throw new Exception("TODO: DBG: END.");
+		}
+
+		$this->_antUrlProjects = array();
+		foreach ($out as $line) {
+			try {
+				if ($this->pathUrlActions != substr($line, 0, strlen($this->pathUrlActions))) throw new Exception("Wrong line prefix '{$line}' - skip");
+				if ('/build.xml' != substr($line, -1 * strlen('/build.xml'))) throw new Exception("Wrong line suffix '{$line}' - expected '/build.xml' - skip");
+			} catch (Exception $e) {
+				UI::alert('warning', $e->getMessage());
+				continue;
+			}
+			$line = substr($line, strlen($this->pathUrlActions) + 1);
+			$path = substr($line, 0, -1 * strlen('/build.xml'));
+			$this->_antUrlProjects[$path] = $path;
+			try {
+				V::exec("cd {$this->pathUrlActions}/{$path} && ant -p|grep -v '^Unable to locate'|grep -v '^Buildfile:'", $out, $ret);
+				// Test WFS for actions given featureID   // TODO: first line - project description
+				// Main targets:
+				//
+				//  DescribeFeatureType  URL_TASK Target DescribeFeatureType
+				//  GetFeature           URL_TASK Target GetFeature
+				// Default target: http_first_input
+				if (!empty($out)) {
+					$projectDesc = '';
+					$templates = [];
+					$state = 'projectDesc';// 'projectDesc', 'Main targets', 'Default target'
+					foreach ($out as $line) {
+						switch ($state) {
+							case 'projectDesc': {
+								if ('Main targets' == substr($line, 0, strlen('Main targets'))) {
+									$state = 'Main targets';
+								} else {
+									$line = trim($line);
+									if (!$projectDesc && $line) $projectDesc = $line;
+								}
+							} break;
+							case 'Main targets': {
+								if (false !== ($pos = strpos($line, 'URL_TASK'))) {
+									$templateName = trim(substr($line, 0, $pos));
+									$label = trim(substr($line, $pos + 9));
+									if (!empty($templateName)) $templates[$templateName] = (!empty($label)) ? $label : $templateName;
+								}
+								if ('Default target' == substr($line, 0, strlen('Default target'))) {
+									$state = 'Default target';
+								}
+							} break;
+						}
+					}
+					if (!empty($projectDesc)) $this->_antUrlProjects[$path] = $projectDesc;
+					if (!empty($templates)) foreach ($templates as $t => $l) $this->_antUrlProjectTemplates[$path][$t] = $l;
+				}
+			} catch (Exception $e) {
+				DBG::log($e);
+			}
+		}
+		DBG::log((array)$this, 'array', "DBG::getAntUrlActionList END Ant projects and main targets");
+		return $this->_antUrlProjects;
+	}
+	public function getAntUrlActionTemplates($path) {
+		if (!empty($this->_antUrlProjectTemplates[$path])) return $this->_antUrlProjectTemplates[$path];
+		$this->getAntUrlActionList();
+		if (!empty($this->_antUrlProjectTemplates[$path])) return $this->_antUrlProjectTemplates[$path];
+	}
+	public function getAntToolList() {
+		V::exec("ls -1 {$this->pathTools}*/build.xml", $out, $ret);
+		$taskList = array();
+		foreach ($out as $line) {
+			try {
+				if ($this->pathTools != substr($line, 0, strlen($this->pathTools))) throw new Exception("Wrong line prefix '{$line}' - skip");
+				if ('/build.xml' != substr($line, -1 * strlen('/build.xml'))) throw new Exception("Wrong line suffix '{$line}' - expected '/build.xml' - skip");
+			} catch (Exception $e) {
+				UI::alert('warning', $e->getMessage());
+				continue;
+			}
+			$line = substr($line, strlen($this->pathTools));
+			$name = substr($line, 0, -1 * strlen('/build.xml'));
+			$taskList[$name] = $name;// TODO: $name => $description (read from build.xml file first xml tag <project...>)
+		}
+		return $taskList;
+	}
+
+	public function generatePdfAction() {// TODO: OLD TEST
+		$antPath = V::get('ditaPath', '', $_GET);
+		$idKoresp = V::get('idKoresp', 0, $_POST, 'int');
+		$doExecute = V::get('doExecute', '', $_POST);
+
+		$antList = $this->getAntToolList();
+		if (!array_key_exists($antPath, $antList)) throw new Exception("dita path not found", 404);
+
+		UI::gora();
+		UI::startContainer();
+		try {
+			UI::tag('h1', [], "Dita: '{$antList[$antPath]}'");
+
+			UI::startTag('form', ['action'=>"", 'method'=>"POST", 'class'=>'form-inline']);
+			UI::tag('input', ['type'=>'number', 'value'=>$idKoresp, 'class'=>'form-control', 'style'=>'max-width:200px']);
+			UI::tag('input', ['type'=>'hidden', 'name'=>'doExecute', 'value'=>'1']);
+			UI::tag('input', ['type'=>"submit", 'value'=>"Wykonaj", 'class'=>'btn btn-primary']);
+			UI::endTag('form');
+
+			if ($doExecute) {
+				// if ($idKoresp <= 0) throw new Exception("Bad Request - missing id koresp");
+				if ($idKoresp <= 0) UI::alert('danger', "Missing id koresp - using default file");
+				if ($idKoresp > 0) UI::alert('warning', "TODO: generate xml file for id koresp = {$idKoresp}");
+
+				$execPath = APP_PATH_SCHEMA . DS . 'ant' . DS . $antPath;
+				$ant = APP_PATH_WWW . DS . 'stuff' . DS . 'dita-ot-2.3.3' . DS . 'bin' . DS . 'ant';
+				$cmd = "cd {$execPath} && {$ant} 2>&1";// wymaga java jdk
+				V::exec($cmd, $out, $ret);
+				DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
+			}
+
+			throw new Exception("TODO: F." . __FUNCTION__ . " . L." . __LINE__);
+		} catch (Exception $e) {
+			UI::alert('danger', $e->getMessage());
+		}
+		UI::endContainer();
+		UI::dol();
+	}
+
+	public function reinstallAction() {
+		UI::gora();
+		UI::tag('h1', [], 'Reinstall Dita Open Toolkit 2.3.3');
+		$stuffPath = APP_PATH_WWW . DS . 'stuff';
+		// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && rm dita-ot-2.3.3.zip || echo PASSED";
+		// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && wget https://github.com/dita-ot/dita-ot/releases/download/2.3.3/dita-ot-2.3.3.zip -O dita-ot-2.3.3.zip ";
+		// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && rm dita-ot-2.3.3 || echo PASSED";
+		// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff && unzip dita-ot-2.3.3.zip || echo PASSED";
+		// $cmd[]['rsh']="cd /Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3 && ./startcmd.sh || echo PASSED";
+		$wget = "/opt/local/bin/wget";
+		$unzip = "/usr/bin/unzip";
+
+		// $testCmd = "which unzip";
+		// V::exec($testCmd, $out, $ret);
+		// DBG::_(true, true, "testCmd: {$testCmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
+
+		// $testCmd = "which wget";
+		// V::exec($testCmd, $out, $ret);
+		// DBG::_(true, true, "testCmd: {$testCmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
+
+		$cmd = "cd {$stuffPath} ; [ -f dita-ot-2.3.3.zip ] && rm dita-ot-2.3.3.zip";
+		V::exec($cmd, $out, $ret);
+		DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
+
+		$cmd = "cd {$stuffPath} ; {$wget} https://github.com/dita-ot/dita-ot/releases/download/2.3.3/dita-ot-2.3.3.zip -O dita-ot-2.3.3.zip";
+		V::exec($cmd, $out, $ret);
+		DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
+
+		$cmd = "cd {$stuffPath}
 [ -f dita-ot-2.3.3.zip ] && rm dita-ot-2.3.3.zip
 {$wget} https://github.com/dita-ot/dita-ot/releases/download/2.3.3/dita-ot-2.3.3.zip -O dita-ot-2.3.3.zip
 [ -d dita-ot-2.3.3 ] && rm -rf dita-ot-2.3.3
 {$unzip} dita-ot-2.3.3.zip
-    ";
-    V::exec($cmd, $out, $ret);
-    DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
-  }
+		";
+		V::exec($cmd, $out, $ret);
+		DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
+	}
 
 }

+ 3 - 2
SE/se-lib/Route/UrlAction/Ant.php

@@ -58,6 +58,7 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
                   'primaryKey' => $primaryKey,
                   'primaryKeyField' => $pkField
                 ]),
+                // TODO: 'onclick' => 'return p5UI_runWPSAsyncJob(event, this)',
                 'class' => 'btn btn-sm btn-link',
               ], '<i class="glyphicon glyphicon-arrow-right"></i> ' . $labelTmpl)
             ]);
@@ -130,8 +131,8 @@ class Route_UrlAction_Ant extends Route_Ant {// @doc @see Route_Ant
 
       $cryptedPass = base64_encode(User::getLogin() . ":" . Crypt::decrypt($_SESSION['ADM_PASS_HASH']));
       $uniqID = date("Y-m-d-H_i_s") . substr(md5(time()), 0, 6);// TODO: uniq id for every request
-      // $cmd = "{$this->pathUrlActions}{$path}/do_build.sh";
-      $cmd = "cd {$this->pathUrlActions}{$path} && ant -S";
+      // $cmd = "{$this->pathUrlActions}/{$path}/do_build.sh";
+      $cmd = "cd {$this->pathUrlActions}/{$path} && ant -S";
       $cmd .= " -DoutputFunctionUrl='{$outputFunctionUrl}'";
       $cmd .= " -DantFunctionUrl='{$antFunctionUrl}'";
       if( strlen($confirmAntfile) > 0 ) $cmd .= " -DconfirmAntfile={$confirmAntfile}";

+ 5 - 0
SE/se-lib/V.php

@@ -713,4 +713,9 @@ EOF';
 		}
 	}
 
+	static function glob($pattern, $flags = 0) {
+		$ret = glob($pattern, $flags);
+		return (false === $ret) ? [] : $ret;
+	}
+
 }