Skip to content

Instantly share code, notes, and snippets.

@Melindrea
Created October 29, 2013 20:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Melindrea/7222188 to your computer and use it in GitHub Desktop.
Save Melindrea/7222188 to your computer and use it in GitHub Desktop.
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