All Projects → sindresorhus → Grunt Php

sindresorhus / Grunt Php

Licence: mit
Start a PHP server

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Grunt Php

Php Server
Start a PHP server
Stars: ✭ 119 (-59.11%)
Mutual labels:  npm-package, webserver
Grunt Email Workflow
A Grunt workflow for designing and testing responsive HTML email templates with SCSS.
Stars: ✭ 3,010 (+934.36%)
Mutual labels:  grunt
stimulus-rails-nested-form
A Stimulus controller to create new fields on the fly to populate your Rails relationship.
Stars: ✭ 54 (-81.44%)
Mutual labels:  npm-package
Input Range Scss
Styling Cross-Browser Compatible Range Inputs with Sass
Stars: ✭ 272 (-6.53%)
Mutual labels:  npm-package
Grunt Filerev
[DEPRECATED] File revving
Stars: ✭ 261 (-10.31%)
Mutual labels:  grunt
Term Img
Display images in iTerm
Stars: ✭ 275 (-5.5%)
Mutual labels:  npm-package
expross
Expross is a lightweight webserver to introduce JavaScript developers familiar with Express to Python.
Stars: ✭ 27 (-90.72%)
Mutual labels:  webserver
Jaguar
Jaguar, a server framework built for speed, simplicity and extensible. ORM, Session, Authentication & Authorization, OAuth
Stars: ✭ 286 (-1.72%)
Mutual labels:  webserver
Tooltip Sequence
A simple step by step tooltip helper for any site
Stars: ✭ 287 (-1.37%)
Mutual labels:  npm-package
Cordova Httpd
Embed tiny web server into Cordova with a plugin
Stars: ✭ 271 (-6.87%)
Mutual labels:  webserver
Electron Store
Simple data persistence for your Electron app or module - Save and load user preferences, app state, cache, etc
Stars: ✭ 3,316 (+1039.52%)
Mutual labels:  npm-package
Grunt Cache Bust
Cache bust static assets using content hashing
Stars: ✭ 262 (-9.97%)
Mutual labels:  grunt
Class Names
Conditionally join CSS class names together - Especially useful with React
Stars: ✭ 281 (-3.44%)
Mutual labels:  npm-package
Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (-12.03%)
Mutual labels:  npm-package
Bitbar
Simplifies BitBar app plugin creation
Stars: ✭ 286 (-1.72%)
Mutual labels:  npm-package
shipyard
A lightweight, CSS framework for Rails & Jekyll applications
Stars: ✭ 16 (-94.5%)
Mutual labels:  npm-package
Odi
🌪🌌 Opinionated, Declarative, Idiomatic framework for building scalable, supportable and reliable enterprise applications.
Stars: ✭ 264 (-9.28%)
Mutual labels:  webserver
Almace Scaffolding
AMSF, a.k.a. Almace Scaffolding, a super-fast Jekyll framework fighting against the website obesity.
Stars: ✭ 275 (-5.5%)
Mutual labels:  grunt
Docker Webserver
WebServer (MariaDB, PHP-FPM, Nginx) composed from several separate containers linked together
Stars: ✭ 290 (-0.34%)
Mutual labels:  webserver
Webserver
A C++ High Performance Web Server
Stars: ✭ 4,164 (+1330.93%)
Mutual labels:  webserver

grunt-php

Start a PHP server

Useful for developing PHP projects or running tests on them.

Pretty much a drop-in replacement for grunt-contrib-connect, except for the middleware option.

Uses the PHP built-in server.

Install

$ npm install --save-dev grunt-php

Usage

require('load-grunt-tasks')(grunt);

grunt.initConfig({
	php: {
		dist: {
			options: {
				port: 5000
			}
		}
	}
});

grunt.registerTask('default', ['php']);

Examples

Start a persistent PHP server and open in browser

grunt.initConfig({
	php: {
		test: {
			options: {
				keepAlive: true,
				open: true
			}
		}
	}
});

grunt.registerTask('test', ['php', 'mocha']);

Use it with BrowserSync

grunt.initConfig({
	php: {
		dist: {
			options: {
				port: 9000,
				base: 'dist' // Project root
			}
		}
	},
	browserSync: {
		dist: {
			bsFiles: {
				src: [
					// Files you want to watch for changes
				]
			},
			options: {
				proxy: '<%= php.dist.options.hostname %>:<%= php.dist.options.port %>',
				watchTask: true,
				notify: true,
				open: true,
				logLevel: 'silent',
				ghostMode: {
					clicks: true,
					scroll: true,
					links: true,
					forms: true
				}
			}
		}
	},
	watch: {
		// Your watch tasks
	}
});

grunt.registerTask('serve', [
	'php:dist',         // Start PHP Server
	'browserSync:dist', // Using the PHP instance as a proxy
	'watch'             // Any other watch tasks you want to run
]);

Use it with grunt-contrib-watch

grunt.initConfig({
	php: {
		watch: {}
	}
});

grunt.registerTask('phpwatch', ['php:watch', 'watch']);

Add path for a custom error log

const path = require('path');

grunt.initConfig({
	php: {
		dist: {
			options: {
				directives: {
					'error_log': path.resolve('logs/error.log')
				}
			}
		}
	}
});

grunt.registerTask('default', ['php']);

Options

Supports all the php-server options in addition to the ones below.

keepAlive

Type: boolean
Default: false

Keep the server alive indefinitely. Any task specified after this will not run.

This option can also be enabled ad-hoc by running the task like grunt php:targetname:keepAlive.

silent

Type: boolean
Default: false

Suppress output produced by the PHP server.

Related

License

MIT © Sindre Sorhus

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].