protected $ssh = null;
protected $longArgSeparator = '=';
protected $timeout = 0;
+ protected $json = false;
function __construct($program, $output = null, $error = true)
{
$commande = 'nohup ' . $commande;
}
+ if ($this->json) {
+ $commande = 'sudo ' . $commande;
+ }
+
$commandes[] = $commande;
$this->commande = implode(';', $commandes);
$this->timeout = $timeout;
}
+
+ /**
+ * @return bool
+ */
+ public function isJson(): bool
+ {
+ return $this->json;
+ }
+
+ /**
+ * @param bool $json
+ */
+ public function setJson(bool $json): void
+ {
+ $this->json = $json;
+ }
}
+++ /dev/null
-<?php
-
-namespace Cubist\Util\CommandLine\Imagemagick;
-
-use Cubist\Util\CommandLine;
-
-class Npx extends CommandLine
-{
- public function __construct($program = 'npx', $output = null, $error = true)
- {
- parent::__construct($program, $output, $error);
- }
-
- public function setModule($module)
- {
- $this->setManualArg($module);
- }
-
- public function execute($fonction = 'shell_exec')
- {
- parent::execute($fonction);
- }
-}
\ No newline at end of file
--- /dev/null
+<?php
+
+namespace Cubist\Util\CommandLine;
+
+use Cubist\Util\CommandLine;
+
+class Npx extends CommandLine
+{
+ public function __construct($program = 'npx', $output = null, $error = true)
+ {
+ parent::__construct($program, $output, $error);
+ }
+
+ public function setModule($module)
+ {
+ $this->setManualArg($module);
+ }
+
+ public function execute($fonction = 'shell_exec')
+ {
+ parent::execute($fonction);
+ }
+}
\ No newline at end of file