mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
update: inline args.
This commit is contained in:
@@ -222,8 +222,7 @@ class HttpHandler
|
||||
if (function_exists('posix_getpid')) {
|
||||
$pid = posix_getpid();
|
||||
if ($pid) {
|
||||
$delay = 5;
|
||||
$command = 'sh -c ' . escapeshellarg("sleep {$delay}; kill {$pid} >/dev/null 2>&1");
|
||||
$command = 'sh -c ' . escapeshellarg("sleep 5; kill $pid >/dev/null 2>&1");
|
||||
@exec($command . ' >/dev/null 2>&1 &');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,9 +228,8 @@ class Server
|
||||
|
||||
private function dockerImageExists(string $image): bool
|
||||
{
|
||||
$name = escapeshellarg($image);
|
||||
$result = 1;
|
||||
exec("docker image inspect $name >/dev/null 2>&1", $output, $result);
|
||||
exec("docker image inspect " . escapeshellarg($image) . " >/dev/null 2>&1", $output, $result);
|
||||
return $result === 0;
|
||||
}
|
||||
|
||||
@@ -304,8 +303,7 @@ class Server
|
||||
$args[] = '--entrypoint=' . $entrypoint;
|
||||
$args[] = $image;
|
||||
|
||||
$escaped = array_map(escapeshellarg(...), $args);
|
||||
$command = implode(' ', $escaped);
|
||||
$command = implode(' ', array_map(escapeshellarg(...), $args));
|
||||
passthru($command, $status);
|
||||
exit($status);
|
||||
}
|
||||
|
||||
@@ -782,8 +782,7 @@ class Install extends Action
|
||||
$command[] = '-d';
|
||||
$command[] = '--remove-orphans';
|
||||
$command[] = '--renew-anon-volumes';
|
||||
$escaped = array_map(escapeshellarg(...), $command);
|
||||
$commandLine = $env . implode(' ', $escaped) . ' 2>&1';
|
||||
$commandLine = $env . implode(' ', array_map(escapeshellarg(...), $command)) . ' 2>&1';
|
||||
\exec($commandLine, $output, $exit);
|
||||
|
||||
if ($exit !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user