From 7307907585fda5d3e68ffe767d57605ef3a794e2 Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Tue, 23 Apr 2019 20:18:41 +0200 Subject: [PATCH] [WebserverBundle] Deprecate the bundle in favor of symfony local server --- .../Bundle/WebServerBundle/Command/ServerLogCommand.php | 4 ++++ .../Bundle/WebServerBundle/Command/ServerRunCommand.php | 4 ++++ .../Bundle/WebServerBundle/Command/ServerStartCommand.php | 4 ++++ .../Bundle/WebServerBundle/Command/ServerStatusCommand.php | 4 ++++ .../Bundle/WebServerBundle/Command/ServerStopCommand.php | 4 ++++ .../DependencyInjection/WebServerExtension.php | 4 ++++ .../Tests/DependencyInjection/WebServerExtensionTest.php | 3 +++ src/Symfony/Bundle/WebServerBundle/WebServer.php | 2 ++ src/Symfony/Bundle/WebServerBundle/WebServerBundle.php | 7 +++++++ src/Symfony/Bundle/WebServerBundle/WebServerConfig.php | 2 ++ 10 files changed, 38 insertions(+) diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php index 73c51cc8e09e4..dcd3752366de7 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php @@ -24,6 +24,8 @@ /** * @author Grégoire Pineau + * + * @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 { @@ -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)) { diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php index e306a65925f87..53c9c807adba1 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php @@ -26,6 +26,8 @@ * Runs Symfony application using a local web server. * * @author Michał Pipa + * + * @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 { @@ -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')) { diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php index c481856b291b1..3e17c87bce524 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php @@ -26,6 +26,8 @@ * Runs a local web server in a background process. * * @author Christian Flothmann + * + * @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 { @@ -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')) { diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php index bedb31a678461..5912b9d883cdd 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php @@ -25,6 +25,8 @@ * the background. * * @author Christian Flothmann + * + * @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 { @@ -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')) { diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php index 9287c2196c0a4..762bf6d869ced 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php @@ -23,6 +23,8 @@ * Stops a background process running a local web server. * * @author Christian Flothmann + * + * @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 { @@ -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 { diff --git a/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php b/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php index bf263e1bb654e..b7d5878e8cb45 100644 --- a/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php +++ b/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php @@ -19,6 +19,8 @@ /** * @author Robin Chalas + * + * @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 { @@ -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) diff --git a/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php b/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php index 55175f0639f8f..42eb6ade9b7d3 100644 --- a/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php +++ b/src/Symfony/Bundle/WebServerBundle/Tests/DependencyInjection/WebServerExtensionTest.php @@ -18,6 +18,9 @@ class WebServerExtensionTest extends TestCase { + /** + * @group legacy + */ public function testLoad() { $container = new ContainerBuilder(); diff --git a/src/Symfony/Bundle/WebServerBundle/WebServer.php b/src/Symfony/Bundle/WebServerBundle/WebServer.php index d23a8d8ddca8d..978c5bb17a59f 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServer.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServer.php @@ -19,6 +19,8 @@ * Manages a local HTTP web server. * * @author Fabien Potencier + * + * @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 { diff --git a/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php b/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php index 3e3f41f45c978..22b541fca3fec 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php @@ -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); + } } diff --git a/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php b/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php index 10e6ae4c81b4c..e5ae3eed71df3 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php @@ -13,6 +13,8 @@ /** * @author Fabien Potencier + * + * @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 {