Update exectool.php

This commit is contained in:
Namhyeon Go 2020-07-10 16:38:45 +09:00 committed by GitHub
parent b859a236a8
commit 1ee86700cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,6 +134,11 @@ if(!is_fn("exec_command")) {
return $return;
}
// An 'async' option will be return PID
if(array_key_equals("async", $options, true)) {
$command = sprintf("%s 1>/dev/null 2>&1 & echo $!;", $command);
}
if (empty($method)) {
// ob_start() will turn on output buffering to collect all output from
// exec_test() and ob_end_clean() will clean the buffer afterwards ("garbage collection")
@ -149,11 +154,6 @@ if(!is_fn("exec_command")) {
}
}
// An 'async' option will be return PID
if(array_key_equals("async", $options, true)) {
$command = sprintf("%s 1>/dev/null 2>&1 & echo $!;", $command);
}
ob_start();
switch ($method) {