-
Notifications
You must be signed in to change notification settings - Fork 186
Added a feature to serve the app using the terminal command 'php codeholic serve' #24
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 a feature to serve the app using the terminal command 'php codeholic serve' #24
Conversation
...lic serve' command...
... which to try running PHP's built-in server on...
That is awesome @aditya-zanjad. Thank you for it.
I will test it and as far as there are no issue I will merge this.
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 feature is great. Thanks for contributing.
.vscode/settings.json
Outdated
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.
I think we should completely ignore .vscode
folder.
codeholic
Outdated
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.
When the default port is occupied and this code is executed. Code throws an error and does not try to allocate next port.
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.
@thecodeholic Thanks for notifying me about these issues. I'll try to fix them ASAP.
...rsion is '8.0.0' or up...
...mework into implement_php_codeholic_serve
@thecodeholic Thank you for the feedback. The suggested changes are now implemented. Thank you.
@aditya-zanjad Thank you for this.
I will review it and test and then merge if everything looks good.
I love the feature. Well Done.
...ncremented in the for loop...
...te exception messages...
Uh oh!
There was an error while loading. Please reload this page.
Added an alternate way to serve the app using the terminal command
php codeholic serve
From the root directory, where
README.md
file is located, you can now run the following terminal command to serve the app.FIRST NOTE
The file
codeholic.php
has been renamed to justcodeholic
.This way we can just run
php codeholic serve
instead ofphp codeholic.php serve
.SECOND NOTE
In the fourth commit, added the ability to specify port number & host url for the command
php codeholic serve
.Now, we can specify parameters '--port' & '--host'. If the user does not provide any value for
--port
argument, then its default value will always be8080
.Some examples below:
THIRD NOTE
In the seventh commit, added the option to specify the parameter
--max-port
to decide the limit upto which to try to run the PHP's built-in server on before showing a failure message. The value of the parameter--max-port
should always be equal to or greater than the value of the parameter--port
.If the user does not provide any value for
--port
argument, then its default value will always be8080
.Also, there is a hard limit set on the value of
--max-port
. This means, the value of--max-port
should never be greater than the addition of value of--port
plus100
. This is done to make sure that thefor loop
in the program will not like run forever.Some valid examples below:
Some invalid examples below: