From: Vincent Vanwaelscappel Date: Tue, 16 Jan 2024 19:03:52 +0000 (+0100) Subject: wip #6615 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6ff79c918b8a3c8f8fb166867c64a94ec53e3d11;p=cubist_util.git wip #6615 --- diff --git a/src/CommandLine.php b/src/CommandLine.php index ef069cf..6e77add 100644 --- a/src/CommandLine.php +++ b/src/CommandLine.php @@ -26,13 +26,21 @@ class CommandLine function __construct($program, $output = null, $error = true) { + $p = $program; + + if (stristr($program, ' ')) { $program = '"' . $program . '"'; } $this->program = $program; $this->commande = null; if (null === $output) { - $this->output = tempnam(sys_get_temp_dir(), 'Cubist'); + $e = Text::multiExplode('/\\', $p); + $prefix = 'Cubist'; + if (count($e)) { + $prefix = array_pop($e); + } + $this->output = tempnam(sys_get_temp_dir(), $prefix ?: 'Cubist'); } else { $this->temp_output = false; $this->output = $output;