From b94cc72fd15247d56d37cccd6a19f7a9e97885cb Mon Sep 17 00:00:00 2001 From: Toon Van den Bos Date: Thu, 13 Jun 2024 17:59:37 +0200 Subject: [PATCH] Fixed exec result treatment --- src/Connection.php | 4 ++-- src/SecLibGateway.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Connection.php b/src/Connection.php index afbcf43..d0cb73f 100755 --- a/src/Connection.php +++ b/src/Connection.php @@ -119,9 +119,9 @@ public function run($commands, Closure $callback = null, int $timeout = null) $gateway->setTimeout($timeout); } - $callback = $this->getCallback($callback); + $result = $gateway->run($this->formatCommands($commands)); - $gateway->run($this->formatCommands($commands), $callback); + call_user_func($this->getCallback($callback), $result); } /** diff --git a/src/SecLibGateway.php b/src/SecLibGateway.php index 83b266a..d0f3c8f 100755 --- a/src/SecLibGateway.php +++ b/src/SecLibGateway.php @@ -284,7 +284,7 @@ public function connected() */ public function run($command) { - $this->getConnection()->exec($command, null); + return $this->getConnection()->exec($command, null); } /**