public function addEnvPair($sKey, $sVal)
{
if (isset($sKey) && $sKey && isset($sVal)) {
- if (!isset($this->aEnv)) $this->aEnv = $_ENV;
+ if (!isset($this->aEnv)) {
+ $this->aEnv = $_ENV;
+ }
$this->aEnv = array_merge($this->aEnv, array($sKey => $sVal), $_ENV);
}
return $this;
return join(' ', $aEscaped);
}
- public function run($bExitOnFail = False)
+ public function run($bExitOnFail = false)
{
$sCmd = $this->escapedCmd();
// $aEnv does not need escaping, proc_open seems to handle it fine
return $iStat;
}
-
-
private function escapeParam($sParam)
{
- if (preg_match('/^-*\w+$/', $sParam)) return $sParam;
- return escapeshellarg($sParam);
+ return (preg_match('/^-*\w+$/', $sParam)) ? $sParam : escapeshellarg($sParam);
}
}