From 49387ddfe49f85dd7390252f36d2d169a0c870c3 Mon Sep 17 00:00:00 2001 From: fd6130 Date: Fri, 12 Nov 2021 22:55:07 +0800 Subject: [PATCH] Use remotePhpBinaryPath when run composer --- src/Deployer/DefaultDeployer.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/Deployer/DefaultDeployer.php b/src/Deployer/DefaultDeployer.php index 37fb7ae..f73a0ae 100644 --- a/src/Deployer/DefaultDeployer.php +++ b/src/Deployer/DefaultDeployer.php @@ -349,11 +349,24 @@ private function doInstallDependencies(): void { if (true === $this->getConfig(Option::updateRemoteComposerBinary)) { $this->log('

Self Updating the Composer binary'); - $this->runRemote(sprintf('%s self-update', $this->getConfig(Option::remoteComposerBinaryPath))); + $this->runRemote( + sprintf( + '%s %s self-update', + $this->getConfig(Option::remotePhpBinaryPath), + $this->getConfig(Option::remoteComposerBinaryPath) + ) + ); } $this->log('

Installing Composer dependencies'); - $this->runRemote(sprintf('%s install %s', $this->getConfig(Option::remoteComposerBinaryPath), $this->getConfig(Option::composerInstallFlags))); + $this->runRemote( + sprintf( + '%s %s install %s', + $this->getConfig(Option::remotePhpBinaryPath), + $this->getConfig(Option::remoteComposerBinaryPath), + $this->getConfig(Option::composerInstallFlags) + ) + ); } private function doInstallWebAssets(): void @@ -402,7 +415,14 @@ private function doClearControllers(): void private function doOptimizeComposer(): void { $this->log('

Optimizing Composer autoloader'); - $this->runRemote(sprintf('%s dump-autoload %s', $this->getConfig(Option::remoteComposerBinaryPath), $this->getConfig(Option::composerOptimizeFlags))); + $this->runRemote( + sprintf( + '%s %s dump-autoload %s', + $this->getConfig(Option::remotePhpBinaryPath), + $this->getConfig(Option::remoteComposerBinaryPath), + $this->getConfig(Option::composerOptimizeFlags) + ) + ); } private function doCreateSymlink(): void