gulp-php-connect
Start a PHP-server
This is pretty much a gulp version of @sindresorhus's grunt-php and acts as a drop-in replacement for gulp-connect. Useful for running tests on PHP projects.
Uses the built-in server in PHP 5.4.0+.
Install
$ npm install --save-dev gulp-php-connect
Usage
var gulp = connect = ; gulp; gulp;
Examples
Use it with gulp.watch
var gulp = connect = ; gulp; gulp; gulp;
Options
port
Type: number
Default: 8000
The port on which you want to access the webserver. Task will fail if the port is already in use.
hostname
Type: string
Default: '127.0.0.1'
(usually same as localhost
)
The hostname the webserver will use.
Use 0.0.0.0
if you want it to be accessible from the outside.
base
Type: string
Default: '.'
From which folder the webserver will be served. Defaults to the directory of the gulpfile.
keepalive
Type: boolean
Default: true
Keep the server alive indefinitely.
open
Type: boolean
Default: false
Open the server in the browser when the task is triggered.
router
Type: string
Optionally specify the path to a router script that is run at the start of each HTTP request. If this script returns false
, then the requested resource is returned as-is. Otherwise the script's output is returned to the browser.
Example router script:
bin
Type: string
Default: 'php'
Path to the PHP binary. Useful if you have multiple versions of PHP installed.
ini
Type: string
Default: Built-in php.ini
Path to a custom php.ini
config file.
License
MIT © Micah Blu