Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Jul 25, 2012
Merged

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

merged 2 commits into from Jul 25, 2012

Conversation

shin1x1
Copy link
Contributor

@shin1x1 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    

@lorenzo
Copy link
Member

lorenzo commented Jul 12, 2012

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

@shama
Copy link
Contributor

shama commented Jul 12, 2012

LGTM. Nice work @shin1x1!

@jrbasso
Copy link
Member

jrbasso commented Jul 12, 2012

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

@shin1x1
Copy link
Contributor Author

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

@markstory
Copy link
Member

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

@shin1x1
Copy link
Contributor Author

shin1x1 commented Jul 25, 2012

yes, it's ready to merge.

@lorenzo
Copy link
Member

lorenzo commented Jul 25, 2012

Looks good to me

lorenzo added a commit that referenced this pull request Jul 25, 2012
Added ServerShell for PHP Built-in Server into 2.3 branch.
@lorenzo lorenzo merged commit 255705a into cakephp:2.3 Jul 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants