Skip to content

Commit

Permalink
feature #31217 [WebserverBundle] Deprecate the bundle in favor of sym…
Browse files Browse the repository at this point in the history
…fony local server (Simperfit)

This PR was merged into the 4.4 branch.

Discussion
----------

[WebserverBundle] Deprecate the bundle in favor of symfony local server

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | to do <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the master branch.
-->

Since most of the feature added to the symfony local server (using php-fpm) will be handy for all developers and as said in #25748 (comment), I agree that we should deprecate the WebserverBundle in favor of the [Symfony Local Server](https://symfony.com/doc/current/setup/symfony_server.html) cc @stof @fabpot

Commits
-------

7307907 [WebserverBundle] Deprecate the bundle in favor of symfony local server
  • Loading branch information
fabpot committed Jul 8, 2019
2 parents 87a6f04 + 7307907 commit 400eaa6
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 0 deletions.
Expand Up @@ -25,6 +25,8 @@

/**
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class ServerLogCommand extends Command
{
Expand Down Expand Up @@ -78,6 +80,8 @@ protected function configure()

protected function execute(InputInterface $input, OutputInterface $output)
{
@trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED);

$filter = $input->getOption('filter');
if ($filter) {
if (!class_exists(ExpressionLanguage::class)) {
Expand Down
Expand Up @@ -26,6 +26,8 @@
* Runs Symfony application using a local web server.
*
* @author Michał Pipa <michal.pipa.xsolve@gmail.com>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class ServerRunCommand extends Command
{
Expand Down Expand Up @@ -90,6 +92,8 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED);

$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);

if (null === $documentRoot = $input->getOption('docroot')) {
Expand Down
Expand Up @@ -26,6 +26,8 @@
* Runs a local web server in a background process.
*
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class ServerStartCommand extends Command
{
Expand Down Expand Up @@ -90,6 +92,8 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED);

$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);

if (!\extension_loaded('pcntl')) {
Expand Down
Expand Up @@ -25,6 +25,8 @@
* the background.
*
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class ServerStatusCommand extends Command
{
Expand Down Expand Up @@ -72,6 +74,8 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED);

$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
$server = new WebServer($this->pidFileDirectory);
if ($filter = $input->getOption('filter')) {
Expand Down
Expand Up @@ -23,6 +23,8 @@
* Stops a background process running a local web server.
*
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class ServerStopCommand extends Command
{
Expand Down Expand Up @@ -61,6 +63,8 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED);

$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);

try {
Expand Down
Expand Up @@ -19,6 +19,8 @@

/**
* @author Robin Chalas <robin.chalas@gmail.com>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class WebServerExtension extends Extension
{
Expand All @@ -40,6 +42,8 @@ public function load(array $configs, ContainerBuilder $container)
if (!class_exists(ConsoleFormatter::class)) {
$container->removeDefinition('web_server.command.server_log');
}

@trigger_error('Using the WebserverBundle is deprecated since 4.3, the new symfony local server has more feature, you should use it instead.');
}

private function getPublicDirectory(ContainerBuilder $container)
Expand Down
Expand Up @@ -18,6 +18,9 @@

class WebServerExtensionTest extends TestCase
{
/**
* @group legacy
*/
public function testLoad()
{
$container = new ContainerBuilder();
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Bundle/WebServerBundle/WebServer.php
Expand Up @@ -19,6 +19,8 @@
* Manages a local HTTP web server.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class WebServer
{
Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Bundle/WebServerBundle/WebServerBundle.php
Expand Up @@ -13,6 +13,13 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class WebServerBundle extends Bundle
{
public function boot()
{
@trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED);
}
}
2 changes: 2 additions & 0 deletions src/Symfony/Bundle/WebServerBundle/WebServerConfig.php
Expand Up @@ -13,6 +13,8 @@

/**
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead.
*/
class WebServerConfig
{
Expand Down

0 comments on commit 400eaa6

Please sign in to comment.