Update exectool.php

This commit is contained in:
Namhyeon Go 2018-09-26 20:38:19 +09:00 committed by GitHub
parent f29a12596a
commit a94501b20a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,9 +104,9 @@ if(!function_exists("exec_test")) {
* exec_command() executes a command (like "whoami") with the submited method * exec_command() executes a command (like "whoami") with the submited method
*/ */
if(!function_exists("exec_command")) { if(!function_exists("exec_command")) {
function exec_command($command, $method="shell_exec") { function exec_command($command, $method="shell_exec", $options=array()) {
$return = false; $return = false;
if ($method == "") { if ($method == "") {
// ob_start() will turn on output buffering to collect all output from // 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") // exec_test() and ob_end_clean() will clean the buffer afterwards ("garbage collection")
@ -175,6 +175,15 @@ if(!function_exists("exec_command")) {
$return = ob_get_clean(); $return = ob_get_clean();
// save to cache
$fw = write_stroage_file($return, array(
"storage_type" => "cache",
"filename" => get_hashed_text($return, array(
"salt" => true,
"2p" => true
))
));
return $return; return $return;
} }
} }