Skip to content
Snippets Groups Projects
Commit 7092aca3 authored by hahn's avatar hahn
Browse files

- footer navigation in actions was simplified

- fetch output instead of fille $sPhpOut
- ajax test No. 13

!!! DO NOT DEPLOY ON LIVE !!!
parent d557bac8
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ $oPrj = new project($aParams["prj"]);
$sOut = '';
if (array_key_exists("confirm", $aParams)) {
$sOutDir = "/tmp";
$sOutDir = sys_get_temp_dir();
// start action as background process
if (array_key_exists("run", $aParams)) {
......@@ -32,11 +32,16 @@ if (array_key_exists("confirm", $aParams)) {
// read produced content from tempfile
if (array_key_exists("ajax", $aParams)) {
$sLine="<h2 class=\"warning\">processing ... please wait ... " . date("H:i:s")."</h2>";
$sLine="<h2 class=\"warning\">processing ... please wait ...</h2>";
$sProcesses="load: "
.shell_exec("uptime")
."<br>current processes:<pre>"
.shell_exec("ps -f | fgrep -v apache | fgrep -v 'ps -f' | fgrep -v fgrep")
."</pre>";
$sTmpFile=$sOutDir."/".$aParams["ajax"];
$sOut=file_exists($sTmpFile)?file_get_contents($sTmpFile):"";
echo $sLine;
echo $sLine. "/" . $sProcesses;
if ($sOut){
echo '<div style="margin-left: 3em; border-left: 5px dotted #eee; padding-left: 1em;">'.$sOut.'</div>' . $sLine;
}
......
......@@ -242,6 +242,9 @@ class project {
// local file for onhold|ready4deployment
$sBase = $this->_aConfig['packageDir'] . "/" . $sPhase . "/" . $this->_aPrjConfig["fileprefix"];
if (!file_exists($this->_aConfig['packageDir'] . "/" . $sPhase)){
mkdir($this->_aConfig['packageDir'] . "/" . $sPhase);
}
if ($sPlace == "onhold")
$sBase.="_onhold";
......@@ -723,7 +726,7 @@ class project {
// ----------------------------------------------------------------------
private function _setProcessOutFile($sNewTempfile=false){
if ($this->_sProcessTempOut) {
if ($this->_sProcessTempOut && file_exists($this->_sProcessTempOut)) {
unlink($this->_sProcessTempOut);
}
$sNewTempfile=sys_get_temp_dir()."/".basename($sNewTempfile);
......@@ -825,7 +828,10 @@ class project {
*/
private function _TempDelete(){
if (!$this->_sProcessTempOut) return false;
return unlink($this->_sProcessTempOut);
if (file_exists($this->_sProcessTempOut)) {
unlink($this->_sProcessTempOut);
}
return file_exists($this->_sProcessTempOut);
}
......@@ -1080,7 +1086,7 @@ class project {
$sReturn.=$this->queue($sFirstLevel, $sTs2);
$this->_TempDelete();
// $this->_setProcessOutFile(false);
$this->_setProcessOutFile(false);
return $sReturn;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment