cakephp/cakephp — pull request #713 by shin1x1 (2012-07-11 16:57:13+00:00)
Title: Added ServerShell for PHP Built-in Server

Hi, I would propose adding new Shell Command.It is ServerShell.

ServerShell provides a httpd server for CakePHP application without other httpd server(Apache, nginx etc).

It is use PHP CLI build-in server.

Use case is below.

### 1. default (http://localhost/)

$ cd /path/to/app
$ ./Console/cake server

Welcome to CakePHP v2.2.0 Console
---------------------------------------------------------------
App : app
Path: /path/to/app/
---------------------------------------------------------------
ServerHost : localhost
ListenPort : 80
DocumentRoot: /path/to/app/webroot
---------------------------------------------------------------
[WARNING] Don't use this at the production enviroment
built-in server is running...

### 2. specify ListenPort (http://localhost:8000/)

$ ./Console/cake server -p 8000

Welcome to CakePHP v2.2.0 Console
---------------------------------------------------------------
App : app
Path: /path/to/app/
---------------------------------------------------------------
ServerHost : localhost
ListenPort : 8000
DocumentRoot: /path/to/app/webroot
---------------------------------------------------------------
[WARNING] Don't use this at the production enviroment
built-in server is running...

### 3. usage

$ ./Console/cake -h

Welcome to CakePHP v2.2.0 Console
---------------------------------------------------------------
App : app
Path: /Users/shin/sandbox/cakephp_shin1x1/app/
---------------------------------------------------------------
PHP Built-in Server for CakePHP

Usage:
cake server [-h] [-v] [-q] [-H] [-p] [-d]

Options:

--help, -h Display this help.
--verbose, -v Enable verbose output.
--quiet, -q Enable quiet output.
--host, -H ServerHost
--port, -p ListenPort
--document_root, -d DocumentRoot

### 4. PHP 5.3 or lower

$ ./Console/cake server

Welcome to CakePHP v2.2.0 Console
---------------------------------------------------------------
App : app
Path: /path/to/app/
---------------------------------------------------------------
ServerHost : localhost
ListenPort : 80
DocumentRoot: /path/to/app/webroot
---------------------------------------------------------------
This command is available on PHP5.4 or above