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 #713
Conversation
+1 but give it a better name like PhpWebserverShell and change the pull request to merge it into 2.3, not master. |
Can we have shorter output, say:
Also, |
const DEFAULT_PORT = 80; | ||
|
||
/** | ||
* server host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not our indentation style for comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please use hard tabs rather then spaces.
Calling unset() on string indices fails fatally on 5.3.x and lower. Fixes #3027
@@ -70,6 +70,11 @@ | |||
define('WWW_ROOT', dirname(__FILE__) . DS); | |||
} | |||
|
|||
// for built-in server | |||
if (php_sapi_name() == 'cli-server') { | |||
$_SERVER['PHP_SELF'] = '/'.basename(__FILE__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off here, Cake uses hard tabs.
This change is also similar to #634 |
Thanks for all the comments! @burzum Hi, I change the pull request to 2.3 branch. but I will enter many characters.
ServerShell is shorter.
@rchavik good idea! I try to shorter output message. |
…into pr_server_shell Conflicts: lib/Cake/Console/Command/ServerShell.php
@shin1x1 I clearly prefer to type a few characters more in favor for a better variable, class or shell name than ending up with non specific and generic names. To be honest, at least for me, and I do not think for any person who's programming for some time it really doesn't matter if you type 6 or 12 chars. |
I'd rather have the shorter name personally. php_web_server is a bit redundant, what other kind of server would you be starting other than a php + web server? |
how about http_server ? also, is it possible to squash these commits in a logical chunks? |
nevermind about the squash, i just saw your #714. nice. |
@burzum I think that variable, class name should be a specific, too. I type a few chars with code completion(Vim, Emacs, Eclipse). But shell name is need to enter full chars. so, I like short name. |
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/)
2. specify ListenPort (http://localhost:8000/)
3. usage
4. PHP 5.3 or lower