protected $timeout = 0;
protected $sudo = false;
- function __construct($program, $output = null, $error = true)
+ function __construct($program, $output = null, $error = true, $outputPrefix = null)
{
$p = $program;
$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;