getAntUrlActionList(); DBG::nicePrint($taskList, 'ant-url_action'); $featureID = V::get('featureID', '', $_GET); $namespace = V::get('namespace', '', $_GET); // TODO: validate missing ... UI::startTag('ul'); foreach ($taskList as $path => $label) { $link = "index.php?_route=UrlAction_Ant&_task=ant&path={$path}&namespace={$namespace}&featureID={$featureID}"; 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 { echo UI::h('h1', [], "Ant action"); $path = V::get('path', '', $_GET); if (!$path) throw new Exception("Missing Ant path!"); $featureID = V::get('featureID', '', $_GET); $namespace = V::get('namespace', '', $_GET); // TODO: validate missing ... DBG::nicePrint($path, '$path'); DBG::nicePrint($featureID, '$featureID'); DBG::nicePrint($namespace, '$namespace'); $taskList = $this->getAntUrlActionList(); if (!array_key_exists($path, $taskList)) throw new Exception("Ant path not exists! '{$path}'"); echo UI::h('hr'); $testUrl = Request::getPathUri() . "wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003&featureID=TEST_PERMS.63"; $cryptedPass = base64_encode(User::getLogin() . ":" . Crypt::decrypt($_SESSION['ADM_PASS_HASH'])); $cmd = "cd {$this->pathUrlActions}{$path} && {$this->antBin} -S -Durl='{$testUrl}' -DpasswordBase64Basic='{$cryptedPass}' 2>&1"; DBG::nicePrint(str_replace(APP_PATH_ROOT, 'SE', $cmd), 'command'); V::exec($cmd, $out, $ret); DBG::nicePrint($out, 'output'); $html = []; $startRead = false; foreach ($out as $line) { if (!$startRead) { if ('OUTPUT__START' == $line) { $startRead = true; continue; } } else { if ('getMessage()); DBG::log($e); } UI::dol(); } }