Added ServerShell for PHP Built-in Server into 2.3 branch. #714

Merged
merged 2 commits into from Jul 25, 2012

Conversation

Projects
None yet
6 participants
Contributor

shin1x1 commented Jul 12, 2012

This pull request is from #713 .

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.3.0-dev Console
---------------------------------------------------------------
App : app
Path: /path/to/app/
DocumentRoot: /path/to/app/webroot
---------------------------------------------------------------
built-in server is running in http://localhost/

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

$ ./Console/cake server -p 8000

Welcome to CakePHP v2.3.0-dev Console
---------------------------------------------------------------
App : app
Path: /path/to/app/
DocumentRoot: /path/to/app/webroot
---------------------------------------------------------------
built-in server is running in http://localhost:8000/

3. usage

$ ./Console/cake -h

Welcome to CakePHP v2.3.0-dev Console
---------------------------------------------------------------
App : app
Path: /path/to/app/
DocumentRoot: /path/to/app/webroot
---------------------------------------------------------------
PHP Built-in Server for CakePHP
[WARN] Don't use this at the production environment

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.3.0-dev Console
---------------------------------------------------------------
App : app
Path: /path/to/app/
DocumentRoot: /path/to/app/webroot
---------------------------------------------------------------
This command is available on PHP5.4 or above    
Owner

lorenzo commented Jul 12, 2012

Looks good to me, what do the others have to say about this?

Contributor

shama commented Jul 12, 2012

LGTM. Nice work @shin1x1!

Member

jrbasso commented Jul 12, 2012

I like it! But has some code standards issues, please run the phpcs to fix them.

Contributor

shin1x1 commented Jul 14, 2012

@jrbasso thanks! I fixed phpcs errors.

% phpcs --standard=CakePHP lib/Cake/Console/Command/ServerShell.php
Time: 1 second, Memory: 3.75Mb
Owner

markstory commented Jul 25, 2012

So is this ready to merge in? It looks pretty good to me.

Contributor

shin1x1 commented Jul 25, 2012

yes, it's ready to merge.

Owner

lorenzo commented Jul 25, 2012

Looks good to me

lorenzo added a commit that referenced this pull request Jul 25, 2012

Merge pull request #714 from shin1x1/pr_server_shell_2.3
Added ServerShell for PHP Built-in Server into 2.3 branch.

@lorenzo lorenzo merged commit 255705a into cakephp:2.3 Jul 25, 2012

There should be a new line in here. I thought phpcs would see that.

Contributor

shama replied Oct 29, 2012

@renansaddam Was submitting a CS patch and saw your comment. Figured I'd include them here: #928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment