Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP tasks for grunt
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
// configurable paths
var yeomanConfig = {
app: 'app/src',
dist: 'public_html/assets',
php: 'app'
};
grunt.initConfig({
yeoman: yeomanConfig,
phplint: {
options: {
swapPath: '/tmp'
},
all: [
'<%= yeoman.php %>/**/*.php'
]
},
phpcs: {
application: {
dir: '<%= yeoman.php %>'
},
tests: {
dir: 'test/phpunit'
},
options: {
bin: 'composer_components/bin/phpcs',
standard: 'PSR2',
ignore: 'database',
extensions: 'php'
}
},
phpunit: {
classes: {
dir: 'test/phpunit/tests'
},
options: {
bin: 'composer_components/bin/phpunit',
bootstrap: 'bootstrap/autoload.php',
staticBackup: false,
colors: true,
noGlobalsBackup: false
}
}
});
grunt.registerTask('default', [
'phplint',
'phpcs',
'phpunit'
]);
};
{
"name": "php-for-grunt",
"version": "0.0.0",
"devDependencies": {
"grunt": "~0.4.1",
"load-grunt-tasks": "~0.1.0",
"time-grunt": "~0.1.1",
"grunt-phplint": "~0.0.5",
"grunt-phpunit": "~0.3.0",
"grunt-phpcs": "~0.2.0"
},
"engines": {
"node": ">=0.8.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment