Closed
Description
The problem
The server:run
command is both good and bad for beginners. It's good because it makes unnecessary to mess with Apache configuration. But it's bad because executing it blocks the console:
$ php app/console server:run
Server running on localhost:8000
As server:run
doesn't return the user to the regular shell, he/she needs to open another console or he/she needs to launch the command in the background (server run &
).
The proposed solution
I'd like to replace the current server:run
command with three new commands modeled after the traditional web servers:
server:start
, it launches the built-in web server in the background and return the user to the regular shell.server:status
, it checks if the server is running and tells you the URL and the port.server:stop
, it stops the server launched with theserver:start
command.
As an added bonus, when launching the built-in server, the command could also check the availability of the 8000
port to choose the next available port number when the 8000
port is already used.