Skip to content

Commit

Permalink
feature #21039 Web server bundle (fabpot)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.3-dev branch (closes #21039).

Discussion
----------

Web server bundle

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21040
| License       | MIT
| Doc PR        | n/a

Moved the `server:*` commands to a new bundle. It makes them more easily discoverable and more decoupled. Discoverability is important when not using symfony/symfony. In that case, the commands are not available unless you have the symfony/process component installed. With a dedicated bundle, installing the bundle also installs the dependency, making the whole process easier.

Usage is the same as the current commands for basic usage:

To start a web server in the foreground:

```
bin/console server:run
```

To manage a background server:

```
bin/console server:start
bin/console server:stop
bin/console server:status
```

The big difference is that port is auto-determined if something is already listening on port 8000.

Usage is **different** if you pass options:

```
bin/console server:start 127.0.0.1:8888
bin/console server:stop # no need to pass the address again
bin/console server:status # no need to pass the address again
```

That's possible as the web server now stores its address in a pid file stored in the current directory.

Commits
-------

f39b327 [WebServerBundle] switched auto-run of server:start to off by default
961d1ce [WebServerBundle] fixed server:start when already running
126f4d9 [WebServerBundle] added support for port auto-detection
6f689d6 [WebServerBundle] changed the way we keep track of the web server
585d445 [WebServerBundle] tweaked command docs
fa7ebc5 [WebServerBundle] moved most of the logic in a new class
951a1a2 [WebServerBundle] changed wording
ac1ba77 made the router configurable via env vars
48dd2b0 removed obsolete check
132902c moved server:* command to a new bundle
  • Loading branch information
fabpot committed Jan 6, 2017
2 parents 0f50b4d + f39b327 commit be85fcc
Show file tree
Hide file tree
Showing 22 changed files with 743 additions and 655 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"symfony/validator": "self.version",
"symfony/var-dumper": "self.version",
"symfony/web-profiler-bundle": "self.version",
"symfony/web-server-bundle": "self.version",
"symfony/workflow": "self.version",
"symfony/yaml": "self.version"
},
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
3.3.0
-----

* The server:* commands and their associated router files were moved to WebServerBundle
* Translation related services are not loaded anymore when the `framework.translator` option
is disabled.
* Added `GlobalVariables::getToken()`
Expand Down
69 changes: 0 additions & 69 deletions src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php

This file was deleted.

175 changes: 0 additions & 175 deletions src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php

This file was deleted.

Loading

0 comments on commit be85fcc

Please sign in to comment.