ParserRequestClass.php
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @class ParserRequestClass
* @brief Treats a parser request. This class inherits from ProcessRequestClass
* @details
*/
class ParserRequestClass extends ProcessRequestClass
{
/*
* @brief Init a params request
*/
public function init()
{
if (!isset($this->requestData))
return false;
$this->requestData->setType(ProcessTypeEnumClass::RUN);
$this->requestData->setBatchEnable(FALSE);
$cmd = KernelConfigClass::getKernelBinPath()."expressionParser ";
foreach ($this->requestData->getExpressions() as $expression)
{
$cmd .= "-e \"".$expression."\" ";
}
$cmd .= "-o \"".$this->requestData->getOutputFileName()."\"";
$this->requestData->setCmd($cmd);
$this->requestData->setEnvVars(KernelConfigClass::getExecEnvVarArray());
if (!parent::init())
return false;
$this->requestData->setSuccess(false);
$this->requestData->setLastErrorMessage('Cannot init parser request');
//create config files
KernelConfigClass::setForceParamsDir($this->requestData->getLocalParamsPath());
KernelConfigClass::write($this->requestData->getWorkingPath(), "", "", $this->requestData->getFunctionsFilePath(), $this->requestData->getConstantsFilePath(), $this->requestData->getParamTemplatesFilePath(), $this->requestData->getFunctionsArgsListFilePath());
KernelConfigClass::setForceParamsDir("");
return true;
}
/*
* @brief Run a params request
*/
public function run()
{
return parent::run();
}
}
?>