Skip to content

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

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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 @@ -77,6 +79,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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