Merged in dheeyi/processmaker/HOR-1422 (pull request #4591)

HOR-1422
This commit is contained in:
Julio Cesar Laura Avendaño
2016-07-21 15:05:25 -04:00
5 changed files with 44 additions and 18 deletions

View File

@@ -5122,9 +5122,12 @@ class G
* 0 to delete the temporary file flag
* 1 to set the temporary file flag.
* 2 or bigger to check if the temporary file exists.
* @content Contains the content of the temporary file
* true to all workspace
* nameWorkspace to specific workspace
* return true if the file exists, otherwise false.
*/
public function isPMUnderUpdating($setFlag = 2)
public function isPMUnderUpdating($setFlag = 2, $content="true")
{
if (!defined('PATH_DATA')) {
return false;
@@ -5136,12 +5139,16 @@ class G
}
} elseif ($setFlag == 1) {
$fp = fopen($fileCheck,'w');
$line = fputs($fp,"true");
$line = fputs($fp,$content);
}
//checking temporary file
if ($setFlag >= 1) {
if (file_exists($fileCheck)) {
return true;
$res['action'] = true;
$fp = fopen($fileCheck, "r");
$res['workspace'] = fread($fp, filesize($fileCheck));
fclose($fp);
return $res;
}
}
return false;