|
|
@@ -347,7 +347,7 @@ jQuery(document).ready(function () {
|
|
|
if ('1' == V::get('DBG_ENCODER_HELP', '', $_REQUEST)) {// encoder help
|
|
|
$cmd = "cd {$installPath}/SE && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder --help ";
|
|
|
$out = ''; $ret = '';
|
|
|
- exec($cmd, $out, $ret);
|
|
|
+ V::exec($cmd, $out, $ret);
|
|
|
DBG::nicePrint($out, "cmd: `{$cmd}` (return:{$ret})");
|
|
|
exit;
|
|
|
}
|
|
|
@@ -368,7 +368,7 @@ jQuery(document).ready(function () {
|
|
|
|
|
|
$cmd = "find . -name '*.php' ";
|
|
|
$out = ''; $ret = '';
|
|
|
- exec("cd {$installPath}/SE && {$cmd}", $out, $ret);
|
|
|
+ V::exec("cd {$installPath}/SE && {$cmd}", $out, $ret);
|
|
|
if ($dbg) DBG::nicePrint($out, "cmd: `{$cmd}` (return:{$ret})");
|
|
|
else DBG::log($out, 'array', "cmd: `{$cmd}` (return:{$ret})");
|
|
|
if (0 !== $ret) throw new Exception("Error at find php files");
|
|
|
@@ -397,7 +397,7 @@ jQuery(document).ready(function () {
|
|
|
$returnValues = [];
|
|
|
foreach ($cmds as $cmd) {
|
|
|
$out = ''; $ret = '';
|
|
|
- exec($cmd, $out, $ret);
|
|
|
+ V::exec($cmd, $out, $ret);
|
|
|
$encoderSummaryLine = end($out);
|
|
|
$returnValues[] = $encoderSummaryLine;
|
|
|
if ($dbg) {
|
|
|
@@ -636,11 +636,11 @@ jQuery(document).ready(function () {
|
|
|
$sshHostUsr = "{$appLicenceInfo->rootLogin}@{$appLicenceInfo->mainServer}";
|
|
|
$sshArgs = (22 != $appLicenceInfo->sshPort)? "-p {$appLicenceInfo->sshPort}" : '';
|
|
|
$scpArgs = (22 != $appLicenceInfo->sshPort)? "-P {$appLicenceInfo->sshPort}" : '';
|
|
|
-
|
|
|
+
|
|
|
$rsyncSshPort = (22 != $appLicenceInfo->sshPort)? "-e 'ssh -p {$appLicenceInfo->sshPort}'" : '';
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (V::get('DBG_REMOTE', '', $_GET)) {// DBG
|
|
|
$cmd = "echo ~";
|
|
|
V::exec("ssh {$sshArgs} {$sshHostUsr} '{$cmd}'", $out, $ret);
|
|
|
@@ -807,10 +807,10 @@ chmod 600 ~/.ssh/authorized_keys;
|
|
|
//$cmd = "ssh -i ~/.ssh/id_rsa server@{$appLicenceInfo->mainServer} 'ls -1'";
|
|
|
$sshPort = (22 != $appLicenceInfo->sshPort)? "-p {$appLicenceInfo->sshPort}" : '';
|
|
|
$cmd = "ssh {$sshPort} {$this->sshArgsSkipHostKey} {$appLicenceInfo->rootLogin}@{$appLicenceInfo->mainServer} 'ls -1'";
|
|
|
- V::exec("$cmd 2>&1", $out, $ret); // http://php.net/manual/pl/function.exec.php says I saw the exec, system, shell_exec and passthru functions,
|
|
|
- //and deduced that the solution was to
|
|
|
- //redirect the standard error (stderr) to the standard output (stdout). It's not very clean, since it mixes stderr with stdout, and I only wanted to log the stderr.
|
|
|
- //But it seems to be the only solution (suggestions are welcome).
|
|
|
+ V::exec("$cmd 2>&1", $out, $ret); // http://php.net/manual/pl/function.exec.php says I saw the exec, system, shell_exec and passthru functions,
|
|
|
+ //and deduced that the solution was to
|
|
|
+ //redirect the standard error (stderr) to the standard output (stdout). It's not very clean, since it mixes stderr with stdout, and I only wanted to log the stderr.
|
|
|
+ //But it seems to be the only solution (suggestions are welcome).
|
|
|
|
|
|
DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
if (0 !== $ret) throw new Exception("Cannot run remote command using rsa key! #{$ret}; Out: ".implode($out)."; Cmd: {$cmd};");
|
|
|
@@ -838,7 +838,7 @@ chmod 600 ~/.ssh/authorized_keys;
|
|
|
|
|
|
foreach ($cmds as $cmd) {
|
|
|
$out = ''; $ret = '';
|
|
|
- exec($cmd, $out, $ret);
|
|
|
+ V::exec($cmd, $out, $ret);
|
|
|
DBG::nicePrint([ 'cmd' => $cmd, 'output' => $out ], "return: {$ret}");
|
|
|
}
|
|
|
// $this->_encodeSource($appLicenceInfo->installPath, $appLicenceInfo->domains);
|