Skip to content

Improving the server:run command #10827

Closed
@javiereguiluz

Description

@javiereguiluz

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 the server: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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)FrameworkBundle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions