Skip to content

Commit

Permalink
Add option to set remote PHP path
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubén Rubio committed May 27, 2017
1 parent 30746d0 commit c8c4896
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Configuration/DefaultConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ final class DefaultConfiguration extends AbstractConfiguration
private $keepReleases = 5;
private $repositoryUrl;
private $repositoryBranch = 'master';
private $remotePhpBinaryPath = 'php';
private $updateRemoteComposerBinary = false;
private $remoteComposerBinaryPath = '/usr/local/bin/composer';
private $composerInstallFlags = '--no-dev --prefer-dist --no-interaction --quiet';
Expand Down Expand Up @@ -123,6 +124,13 @@ public function repositoryBranch(string $branchName) : self
return $this;
}

public function remotePhpBinaryPath(string $path) : self
{
$this->remotePhpBinaryPath = $path;

return $this;
}

public function updateRemoteComposerBinary(bool $updateBeforeInstall) : self
{
$this->updateRemoteComposerBinary = $updateBeforeInstall;
Expand Down
1 change: 1 addition & 0 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ final class Option
const permissionMode = 'permissionMode';
const permissionUser = 'permissionUser';
const permissionGroup = 'permissionGroup';
const remotePhpBinaryPath = 'remotePhpBinaryPath';
const remoteComposerBinaryPath = 'remoteComposerBinaryPath';
const repositoryBranch = 'repositoryBranch';
const repositoryUrl = 'repositoryUrl';
Expand Down
2 changes: 1 addition & 1 deletion src/Deployer/DefaultDeployer.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private function initializeDirectoryLayout(Server $server) : void
$server->set(Property::web_dir, sprintf('%s/%s', $remoteProjectDir, $this->getConfig(Option::webDir)));

// this is needed because some projects use a binary directory different than the default one of their Symfony version
$server->set(Property::console_bin, sprintf('php %s/console', $this->getConfig(Option::binDir) ? $server->get(Property::bin_dir) : $this->findConsoleBinaryPath($server)));
$server->set(Property::console_bin, sprintf('%s %s/console', $this->getConfig(Option::remotePhpBinaryPath), $this->getConfig(Option::binDir) ? $server->get(Property::bin_dir) : $this->findConsoleBinaryPath($server)));
}

// this is needed because it's common for Smyfony projects to use binary directories
Expand Down

0 comments on commit c8c4896

Please sign in to comment.