mirror of
https://github.com/Mibew/geo-ip-plugin.git
synced 2025-01-22 18:10:32 +03:00
Improve build process
This commit is contained in:
parent
471a312549
commit
972abbb4b9
11
gulpfile.js
11
gulpfile.js
@ -9,6 +9,11 @@ var fs = require('fs'),
|
|||||||
gzip = require('gulp-gzip'),
|
gzip = require('gulp-gzip'),
|
||||||
rename = require('gulp-rename');
|
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
|
// Get and install PHP Composer
|
||||||
gulp.task('get-composer', function(callback) {
|
gulp.task('get-composer', function(callback) {
|
||||||
// Check if Composer already in place
|
// Check if Composer already in place
|
||||||
@ -19,9 +24,9 @@ gulp.task('get-composer', function(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get installer from the internet
|
// Get installer from the internet
|
||||||
https.get('https://getcomposer.org/installer', function(response) {
|
https.get(config.getComposerUrl, function(response) {
|
||||||
// Run PHP to install Composer
|
// 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);
|
callback(error ? stderr : null);
|
||||||
});
|
});
|
||||||
// Pass installer code to PHP via STDIN
|
// Pass installer code to PHP via STDIN
|
||||||
@ -31,7 +36,7 @@ gulp.task('get-composer', function(callback) {
|
|||||||
|
|
||||||
// Install Composer dependencies
|
// Install Composer dependencies
|
||||||
gulp.task('composer-install', ['get-composer'], function(callback) {
|
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);
|
callback(error ? stderr : null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user