1 Commits
0.2.0 ... 0.2.1

Author SHA1 Message Date
Aerex
67e34e52b8 refactor(lib): Fixed API change for process symfony 2022-06-19 12:44:50 -05:00

View File

@@ -1,4 +1,4 @@
<?php <?php
namespace Aerex\BaikalStorage; namespace Aerex\BaikalStorage;
@@ -14,20 +14,19 @@ class Console extends AbstractConsole {
private function convertToString($input) { private function convertToString($input) {
if (is_array($input)) { if (is_array($input)) {
return json_encode($input); return json_encode($input);
} }
return $input; return $input;
} }
public function execute($cmd, $args, $input = null, $envs = []) { public function execute($cmd, $args, $input = null, $envs = []) {
$stdin[] = $cmd; $stdin[] = $cmd;
$stdin = array_merge($stdin, $this->defaultArgs, $args); $stdin = array_merge($stdin, $this->defaultArgs, $args);
if (isset($input)) { if (isset($input)) {
$input = $this->convertToString($input); $input = $this->convertToString($input);
} }
$process = new Process(implode(' ', $stdin), null, $envs, $input); $process = new Process($stdin, null, $envs, $input);
$process->inheritEnvironmentVariables();
try { try {
$process->mustRun(); $process->mustRun();