Skip to content

Commit 3a64b5d

Browse files
Merge pull request #11 from philippsander/master
Be able to change php version
2 parents 061cff6 + e6905ea commit 3a64b5d

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 4.4.0
4+
5+
- lets you use a different php version by using `putenv('PHP_BIN=/path/to/your/php')`
6+
37
## 4.3.0
48

59
- add task to stop and start the cron daemon (optional)

src/Deployer/Recipe/N98Magento2Recipe.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static function configuration()
4747
\Deployer\set('webserver_group', 'www-data');
4848

4949
\Deployer\set('phpfpm_service', 'php7.0-fpm');
50+
\Deployer\set('php_bin', getenv('PHP_BIN') ?: 'php');
5051
\Deployer\set('nginx_service', 'nginx');
5152
\Deployer\set('cron_service', 'cron');
5253
}

src/Deployer/Task/MagentoTasks.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static function toggleMaintenenceMode($enabled)
103103
$maintenance = $enabled === true ? 'maintenance:enable' : 'maintenance:disable';
104104

105105
\Deployer\cd('{{release_path_app}}');
106-
\Deployer\run("php bin/magento $maintenance");
106+
\Deployer\run(\Deployer\get('php_bin') . " bin/magento $maintenance");
107107
}
108108

109109
/**
@@ -123,7 +123,7 @@ public static function allowSymlinks()
123123
public static function runSetupUpgrade()
124124
{
125125
\Deployer\cd('{{release_path_app}}');
126-
\Deployer\run('php bin/magento setup:upgrade --keep-generated');
126+
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento setup:upgrade --keep-generated');
127127
}
128128

129129
/**
@@ -162,7 +162,7 @@ public static function updateMagentoConfig()
162162
}
163163

164164
\Deployer\cd('{{release_path_app}}');
165-
\Deployer\run("php bin/magento config:data:import $dir $env");
165+
\Deployer\run(\Deployer\get('php_bin') . " bin/magento config:data:import $dir $env");
166166
}
167167

168168
/**
@@ -180,7 +180,7 @@ public static function updateMagentoConfig()
180180
public static function backupMagentoConfig()
181181
{
182182
\Deployer\cd('{{release_path_app}}');
183-
\Deployer\run('php bin/magento config:data:export --filePerNameSpace=y --format=yaml --filename=config_backup/');
183+
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento config:data:export --filePerNameSpace=y --format=yaml --filename=config_backup/');
184184
}
185185

186186
/**
@@ -189,7 +189,7 @@ public static function backupMagentoConfig()
189189
public static function importCmsData()
190190
{
191191
\Deployer\cd('{{release_path_app}}');
192-
\Deployer\run('php bin/magento cms:import');
192+
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento cms:import');
193193
}
194194

195195
/**
@@ -200,7 +200,7 @@ public static function activateMagentoCache($enabled)
200200
$cache = $enabled === true ? 'cache:enable' : 'cache:disable';
201201

202202
\Deployer\cd('{{release_path_app}}');
203-
\Deployer\run("php bin/magento $cache");
203+
\Deployer\run(\Deployer\get('php_bin') . " bin/magento $cache");
204204
}
205205

206206
/**
@@ -209,7 +209,7 @@ public static function activateMagentoCache($enabled)
209209
public static function disableMagentoFPC()
210210
{
211211
\Deployer\cd('{{release_path_app}}');
212-
\Deployer\run("php bin/magento cache:disable full_page");
212+
\Deployer\run(\Deployer\get('php_bin') . " bin/magento cache:disable full_page");
213213
}
214214

215215
/**
@@ -218,7 +218,7 @@ public static function disableMagentoFPC()
218218
public static function clearMagentoConfigCache()
219219
{
220220
\Deployer\cd('{{release_path_app}}');
221-
\Deployer\run("php bin/magento cache:clear config");
221+
\Deployer\run(\Deployer\get('php_bin') . " bin/magento cache:clear config");
222222
}
223223

224224
/**
@@ -227,7 +227,7 @@ public static function clearMagentoConfigCache()
227227
public static function flushMagentoCache()
228228
{
229229
\Deployer\cd('{{release_path_app}}');
230-
\Deployer\run('php bin/magento cache:flush');
230+
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento cache:flush');
231231
}
232232

233233
/**

0 commit comments

Comments
 (0)