From c3cb22558d37f2dba1cdb5241401a82b324baa93 Mon Sep 17 00:00:00 2001 From: Mischa Braam Date: Mon, 29 Nov 2021 11:53:06 +0100 Subject: [PATCH] Backwards compatbility for running commands --- CHANGELOG.md | 10 ++++++++++ cli/Valet/CommandLine.php | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56de232b..88d9de0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased](https://github.com/weprovide/valet-plus/compare/2.1.0...2.x) +- [#587] Minimum version of symfony/process causes fatal error + +## [2.2.1](https://github.com/weprovide/valet-plus/compare/2.2.0...2.2.1) +- Fix missing dependencies of sebastian/version + +## [2.2.0](https://github.com/weprovide/valet-plus/compare/2.1.0...2.2.0) +- [#517] Nginx config changes for fastcgi_buffers +- [#554] Fix for Brew 2.7.0: brew list without commands - [#551] Replace hardcoded Elasticsearch versions by fetching from Brew - [#546] Add support for PHP 8.0 +- [#583] Add support for ioncube on PHP 7.4 +- Add --build-from-source when installing PHP - Use PHP 7.2 as default version ## [2.1.0](https://github.com/weprovide/valet-plus/compare/2.0.0...2.1.0) diff --git a/cli/Valet/CommandLine.php b/cli/Valet/CommandLine.php index 4729ad8a..0ef69f0b 100644 --- a/cli/Valet/CommandLine.php +++ b/cli/Valet/CommandLine.php @@ -75,7 +75,12 @@ public function runCommand($command, callable $onError = null) $onError = $onError ?: function () { }; - $process = Process::fromShellCommandline($command); + $process = null; + if (is_callable(Process::class, 'fromShellCommandline')) { + $process = Process::fromShellCommandline($command); + } else { + $process = new Process($command); + } $processOutput = ''; $process->setTimeout(null)->run(function ($type, $line) use (&$processOutput) {