]> _ Git - cubist_util.git/commitdiff
wip #6615
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jan 2024 19:03:52 +0000 (20:03 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jan 2024 19:03:52 +0000 (20:03 +0100)
src/CommandLine.php

index ef069cfb888284d1520d4983c7c4ee75a6739705..6e77add8b8c29bd28633e07e6e6673d3b4691cc7 100644 (file)
@@ -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;