mirror of
https://github.com/Mibew/mibew_slack.git
synced 2025-01-22 18:10:30 +03:00
Issue #1 closed. Fixed suhosin error
This commit is contained in:
parent
882c35b0ee
commit
055543a43a
64
gulpfile.js
64
gulpfile.js
@ -9,25 +9,53 @@ var fs = require('fs'),
|
|||||||
gzip = require('gulp-gzip'),
|
gzip = require('gulp-gzip'),
|
||||||
rename = require('gulp-rename');
|
rename = require('gulp-rename');
|
||||||
|
|
||||||
var composer = require("gulp-composer"),
|
var config = {
|
||||||
gutils = require("gulp-util");
|
getComposerUrl: 'https://getcomposer.org/installer',
|
||||||
|
phpBin: 'php -d "suhosin.executor.include.whitelist = phar"',
|
||||||
// ...
|
package: require('./composer.json')
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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() {
|
gulp.task('prepare-release', function() {
|
||||||
var version = require('./package.json').version;
|
var version = require('./package.json').version;
|
||||||
|
|
||||||
@ -43,7 +71,7 @@ gulp.task('prepare-release', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Builds and packs plugins sources
|
// 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.
|
// The "default" task is just an alias for "prepare-release" task.
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user