From 3b2db5bcb62e2d44b1156d446b3086da099a1e5b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 17 Jan 2024 07:31:32 +0100 Subject: [PATCH] wip #6615 --- src/CommandLine.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/CommandLine.php b/src/CommandLine.php index 6e77add..c0c676f 100644 --- a/src/CommandLine.php +++ b/src/CommandLine.php @@ -24,7 +24,7 @@ class CommandLine protected $timeout = 0; protected $sudo = false; - function __construct($program, $output = null, $error = true) + function __construct($program, $output = null, $error = true, $outputPrefix = null) { $p = $program; @@ -36,11 +36,14 @@ class CommandLine $this->commande = null; if (null === $output) { $e = Text::multiExplode('/\\', $p); - $prefix = 'Cubist'; - if (count($e)) { - $prefix = array_pop($e); + if (null === $outputPrefix) { + $outputPrefix = 'Cubist'; + if (count($e)) { + $outputPrefix = array_pop($e); + } } - $this->output = tempnam(sys_get_temp_dir(), $prefix ?: 'Cubist'); + + $this->output = tempnam(sys_get_temp_dir(), $outputPrefix ?: 'Cubist'); } else { $this->temp_output = false; $this->output = $output; -- 2.39.5