Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
67e34e52b8 |
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
namespace Aerex\BaikalStorage;
|
||||
|
||||
@@ -14,20 +14,19 @@ class Console extends AbstractConsole {
|
||||
|
||||
private function convertToString($input) {
|
||||
if (is_array($input)) {
|
||||
return json_encode($input);
|
||||
return json_encode($input);
|
||||
}
|
||||
return $input;
|
||||
}
|
||||
|
||||
public function execute($cmd, $args, $input = null, $envs = []) {
|
||||
$stdin[] = $cmd;
|
||||
$stdin = array_merge($stdin, $this->defaultArgs, $args);
|
||||
$stdin = array_merge($stdin, $this->defaultArgs, $args);
|
||||
|
||||
if (isset($input)) {
|
||||
$input = $this->convertToString($input);
|
||||
}
|
||||
$process = new Process(implode(' ', $stdin), null, $envs, $input);
|
||||
$process->inheritEnvironmentVariables();
|
||||
$process = new Process($stdin, null, $envs, $input);
|
||||
|
||||
try {
|
||||
$process->mustRun();
|
||||
|
Reference in New Issue
Block a user