summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2023-08-03 18:26:35 +0200
committerUrban Müller2023-08-03 19:00:20 +0200
commit14a8629397ec70fc85472baca67c2a5d12d78257 (patch)
tree92492de0d627033cdf63b2c49f9c10fccf117d46 /it.class
parent6c41ded544558d01e87d20000360c682a88303b1 (diff)
downloaditools-14a8629397ec70fc85472baca67c2a5d12d78257.tar.gz
itools-14a8629397ec70fc85472baca67c2a5d12d78257.tar.bz2
itools-14a8629397ec70fc85472baca67c2a5d12d78257.zip
avoid name clashes with stats (mail3831); undercore also illustrates out of band
Diffstat (limited to 'it.class')
-rw-r--r--it.class6
1 files changed, 3 insertions, 3 deletions
diff --git a/it.class b/it.class
index 858bbe4..4bffec5 100644
--- a/it.class
+++ b/it.class
@@ -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");