diff options
-rw-r--r-- | it.class | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -678,7 +678,7 @@ static function filter_keys($array, $keys, $p = array()) * {-opts} array of opts => {value,true,false,null}: it::exec('ls {-opts}', ['-opts' => ["-l" => true]]); * @param $cmd Format string with {keywords} a la ET() * @param $args varargs, contains key => val arrays or positionals for filling in cmd line. val=null expands to nothing - * 'callback' optional closure, $fn($cmd) => print($cmd) for echo, => !print($cmd) for echo and suppress + * '_callback' optional closure, $fn($cmd) => print($cmd) for echo, => !print($cmd) for echo and suppress * @return output of command. shell errors not detectable, consider it::system or see /www/server/log/error_log */ static function exec($cmd, ...$args) @@ -687,7 +687,7 @@ static function exec($cmd, ...$args) $cmd = it::shell_command($cmd, $args); # NOPHPLINT $before = gettimeofday(true); - if ((!($args['callback'] instanceof Closure) || $args['callback']($cmd)) && !EDC('noexec')) + if ((!($args['_callback'] instanceof Closure) || $args['_callback']($cmd)) && !EDC('noexec')) $result = (string)shell_exec("set +o posix\n" . $cmd); @it::log('exec', round((gettimeofday(true) - $before)*1000) . "\t$cmd"); @@ -708,7 +708,7 @@ static function system($cmd, ...$args) $before = gettimeofday(true); $result = 0; - if ((!($args['callback'] instanceof Closure) || $args['callback']($cmd)) && !EDC('noexec')) + if ((!($args['_callback'] instanceof Closure) || $args['_callback']($cmd)) && !EDC('noexec')) system("set +o posix\n" . $cmd, $result); @it::log('exec', round((gettimeofday(true) - $before)*1000) . "\t$cmd"); |