Skip to content

Commit

Permalink
php binary removed
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Apr 16, 2020
1 parent b79027c commit 340f373
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
In order to read more about upgrading and BC breaks have a look at the [UPGRADE Document](UPGRADE.md).

## 2.0.1 (16. April 2020)

+ Fix issue with shared hostings and prefixed PHP binary.

## 2.0.0 (14. April 2020)

> This release breaks the old API! Check the [UPGRADE document](UPGRADE.md) to read more about.
Expand Down
25 changes: 22 additions & 3 deletions luya.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,38 @@

/**
* Override default composer option in order to provide ignore platform reqs flag.
*
* @since 1.0.6
*/
set('composer_options', function() {
$args = null;

if (has(COMPOSER_IGNORE_PLATFORM_REQS)) {
if (has(COMPOSER_IGNORE_PLATFORM_REQS) && get(COMPOSER_IGNORE_PLATFORM_REQS)) {
$args = ' --ignore-platform-reqs';
}

return '{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-suggest' . $args;
});

/**
* Override the behavior of finding the composer binary.
*
* Shared hosting environments might having problem when prefixing the php binary.
*
* @see https://github.com/deployphp/deployer/pull/987 Reason why it has been introduced.
*/
set('bin/composer', function () {
if (commandExist('composer')) {
// original: $composer = locateBinaryPath('composer');
return locateBinaryPath('composer');
}

if (empty($composer)) {
run("cd {{release_path}} && curl -sS https://getcomposer.org/installer | {{bin/php}}");
$composer = '{{release_path}}/composer.phar';
}

return '{{bin/php}} ' . $composer;
});

// before install vendors, install composer global fxp plugin if enabled
before('deploy:vendors', 'luya:composerglobal');

Expand Down

0 comments on commit 340f373

Please sign in to comment.