Skip to content

Commit

Permalink
Improve build process
Browse files Browse the repository at this point in the history
  • Loading branch information
faf committed Sep 24, 2018
1 parent 471a312 commit 972abbb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ var fs = require('fs'),
gzip = require('gulp-gzip'),
rename = require('gulp-rename');

var config = {
getComposerUrl: 'https://getcomposer.org/installer',
phpBin: 'php -d "suhosin.executor.include.whitelist = phar" -d "memory_limit=512M"'
}

// Get and install PHP Composer
gulp.task('get-composer', function(callback) {
// Check if Composer already in place
Expand All @@ -19,9 +24,9 @@ gulp.task('get-composer', function(callback) {
}

// Get installer from the internet
https.get('https://getcomposer.org/installer', function(response) {
https.get(config.getComposerUrl, function(response) {
// Run PHP to install Composer
var php = exec('php', function(error, stdout, stderr) {
var php = exec(config.phpBin, function(error, stdout, stderr) {
callback(error ? stderr : null);
});
// Pass installer code to PHP via STDIN
Expand All @@ -31,7 +36,7 @@ gulp.task('get-composer', function(callback) {

// Install Composer dependencies
gulp.task('composer-install', ['get-composer'], function(callback) {
exec('php -d "suhosin.executor.include.whitelist = phar" composer.phar install --no-dev', function(error, stdout, stderr) {
exec(config.phpBin + ' composer.phar install --no-dev', function(error, stdout, stderr) {
callback(error ? stderr : null);
});
});
Expand Down

0 comments on commit 972abbb

Please sign in to comment.