namespace Cubist\Util;
use Cubist\Net\SSH2;
+use Illuminate\Support\Facades\Log;
class CommandLine
{
public function debug()
{
- $e = explode('/', $this->program);
- $p = array_pop($e);
- file_put_contents('/tmp/' . $p . '.' . microtime(true) . '.txt', $this->commande . "\n\n" . file_get_contents($this->output));
+ Log::debug($this->commande . "\n\n" . file_get_contents($this->output));
}
public function dd()
protected $_deleteExcluded = false;
protected $_prog = '/usr/bin/rsync';
protected $_sshKey = null;
+ /**
+ * @var bool
+ */
+ protected $_dryRun = false;
public function getSshKey()
{
if ($this->getDeleteExcluded()) {
$this->setArg('delete-excluded');
}
+ if ($this->isDryRun()) {
+ $this->setArg('dry-run');
+ }
$this->setArg('t');
$this->setArg('r');
$this->setArg('v');
$this->setMirror($mirror);
}
+ /**
+ * @param bool $dryRun
+ */
+ public function setDryRun(bool $dryRun): void
+ {
+ $this->_dryRun = $dryRun;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isDryRun(): bool
+ {
+ return $this->_dryRun;
+ }
+
}