Issue #1 closed. Fixed suhosin error

This commit is contained in:
Derek McDaniel 2017-02-02 22:33:01 -05:00
parent 882c35b0ee
commit 055543a43a

View File

@ -9,25 +9,53 @@ var fs = require('fs'),
gzip = require('gulp-gzip'),
rename = require('gulp-rename');
var composer = require("gulp-composer"),
gutils = require("gulp-util");
// ...
composer("init", { "no-interaction": true });
composer('require maknz/slack', {});
if (gutils.env.production) {
composer({
"bin": "/build/share/composer.phar",
"no-ansi": true,
"self-install": false,
});
} else {
//default install
composer();
var config = {
getComposerUrl: 'https://getcomposer.org/installer',
phpBin: 'php -d "suhosin.executor.include.whitelist = phar"',
package: require('./composer.json')
}
// Cleans all built files
gulp.task('clean', function(callback) {
del([
'release',
], callback);
});
// Get and install PHP Composer
gulp.task('get-composer', function(callback) {
// Check if Composer already in place
if (fs.existsSync('./composer.phar')) {
callback(null);
return;
}
// Get installer from the internet
https.get(config.getComposerUrl, function(response) {
// Run PHP to install Composer
var php = exec(config.phpBin, function(error, stdout, stderr) {
callback(error ? stderr : null);
});
// Pass installer code to PHP via STDIN
response.pipe(php.stdin);
});
});
// Install Composer dependencies excluding development ones
gulp.task('composer-install', ['get-composer'], function(callback) {
exec(config.phpBin + ' composer.phar install --no-dev', function(error, stdout, stderr) {
callback(error ? stderr : null);
});
});
// Install all Composer dependencies
gulp.task('composer-install-dev', ['get-composer'], function(callback) {
exec(config.phpBin + ' composer.phar install', function(error, stdout, stderr) {
callback(error ? stderr : null);
});
});
gulp.task('prepare-release', function() {
var version = require('./package.json').version;
@ -43,7 +71,7 @@ gulp.task('prepare-release', function() {
});
// Builds and packs plugins sources
gulp.task('default', ['prepare-release'], function() {
gulp.task('default', ['composer-install','prepare-release'], function() {
// The "default" task is just an alias for "prepare-release" task.
});