diff --git a/CHANGELOG.md b/CHANGELOG.md index 6197a2a..14cea63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 4.4.0 + +- lets you use a different php version by using `putenv('PHP_BIN=/path/to/your/php')` + ## 4.3.0 - add task to stop and start the cron daemon (optional) diff --git a/src/Deployer/Recipe/N98Magento2Recipe.php b/src/Deployer/Recipe/N98Magento2Recipe.php index 75a30b1..97c8a9b 100644 --- a/src/Deployer/Recipe/N98Magento2Recipe.php +++ b/src/Deployer/Recipe/N98Magento2Recipe.php @@ -47,6 +47,7 @@ public static function configuration() \Deployer\set('webserver_group', 'www-data'); \Deployer\set('phpfpm_service', 'php7.0-fpm'); + \Deployer\set('php_bin', getenv('PHP_BIN') ?: 'php'); \Deployer\set('nginx_service', 'nginx'); \Deployer\set('cron_service', 'cron'); } diff --git a/src/Deployer/Task/MagentoTasks.php b/src/Deployer/Task/MagentoTasks.php index 5f938cc..51af603 100644 --- a/src/Deployer/Task/MagentoTasks.php +++ b/src/Deployer/Task/MagentoTasks.php @@ -103,7 +103,7 @@ public static function toggleMaintenenceMode($enabled) $maintenance = $enabled === true ? 'maintenance:enable' : 'maintenance:disable'; \Deployer\cd('{{release_path_app}}'); - \Deployer\run("php bin/magento $maintenance"); + \Deployer\run(\Deployer\get('php_bin') . " bin/magento $maintenance"); } /** @@ -123,7 +123,7 @@ public static function allowSymlinks() public static function runSetupUpgrade() { \Deployer\cd('{{release_path_app}}'); - \Deployer\run('php bin/magento setup:upgrade --keep-generated'); + \Deployer\run(\Deployer\get('php_bin') . ' bin/magento setup:upgrade --keep-generated'); } /** @@ -162,7 +162,7 @@ public static function updateMagentoConfig() } \Deployer\cd('{{release_path_app}}'); - \Deployer\run("php bin/magento config:data:import $dir $env"); + \Deployer\run(\Deployer\get('php_bin') . " bin/magento config:data:import $dir $env"); } /** @@ -180,7 +180,7 @@ public static function updateMagentoConfig() public static function backupMagentoConfig() { \Deployer\cd('{{release_path_app}}'); - \Deployer\run('php bin/magento config:data:export --filePerNameSpace=y --format=yaml --filename=config_backup/'); + \Deployer\run(\Deployer\get('php_bin') . ' bin/magento config:data:export --filePerNameSpace=y --format=yaml --filename=config_backup/'); } /** @@ -189,7 +189,7 @@ public static function backupMagentoConfig() public static function importCmsData() { \Deployer\cd('{{release_path_app}}'); - \Deployer\run('php bin/magento cms:import'); + \Deployer\run(\Deployer\get('php_bin') . ' bin/magento cms:import'); } /** @@ -200,7 +200,7 @@ public static function activateMagentoCache($enabled) $cache = $enabled === true ? 'cache:enable' : 'cache:disable'; \Deployer\cd('{{release_path_app}}'); - \Deployer\run("php bin/magento $cache"); + \Deployer\run(\Deployer\get('php_bin') . " bin/magento $cache"); } /** @@ -209,7 +209,7 @@ public static function activateMagentoCache($enabled) public static function disableMagentoFPC() { \Deployer\cd('{{release_path_app}}'); - \Deployer\run("php bin/magento cache:disable full_page"); + \Deployer\run(\Deployer\get('php_bin') . " bin/magento cache:disable full_page"); } /** @@ -218,7 +218,7 @@ public static function disableMagentoFPC() public static function clearMagentoConfigCache() { \Deployer\cd('{{release_path_app}}'); - \Deployer\run("php bin/magento cache:clear config"); + \Deployer\run(\Deployer\get('php_bin') . " bin/magento cache:clear config"); } /** @@ -227,7 +227,7 @@ public static function clearMagentoConfigCache() public static function flushMagentoCache() { \Deployer\cd('{{release_path_app}}'); - \Deployer\run('php bin/magento cache:flush'); + \Deployer\run(\Deployer\get('php_bin') . ' bin/magento cache:flush'); } /**