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

This commit is contained in:
Amrouche Hamza 2019-04-23 20:18:41 +02:00
parent c202e96cd6
commit 7307907585
No known key found for this signature in database
GPG Key ID: E45A3DA456145BC1
10 changed files with 38 additions and 0 deletions

View File

@ -24,6 +24,8 @@ use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
/**
* @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
{
@ -77,6 +79,8 @@ EOF
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)) {

View File

@ -26,6 +26,8 @@ use Symfony\Component\Process\Process;
* 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
{
@ -90,6 +92,8 @@ EOF
*/
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')) {

View File

@ -26,6 +26,8 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
* 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
{
@ -90,6 +92,8 @@ EOF
*/
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')) {

View File

@ -25,6 +25,8 @@ use Symfony\Component\Console\Style\SymfonyStyle;
* 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
{
@ -72,6 +74,8 @@ EOF
*/
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')) {

View File

@ -23,6 +23,8 @@ use Symfony\Component\Console\Style\SymfonyStyle;
* 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
{
@ -61,6 +63,8 @@ EOF
*/
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 {

View File

@ -19,6 +19,8 @@ use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
/**
* @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
{
@ -40,6 +42,8 @@ class WebServerExtension extends Extension
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)

View File

@ -18,6 +18,9 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
class WebServerExtensionTest extends TestCase
{
/**
* @group legacy
*/
public function testLoad()
{
$container = new ContainerBuilder();

View File

@ -19,6 +19,8 @@ use Symfony\Component\Process\Process;
* 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
{

View File

@ -13,6 +13,13 @@ namespace Symfony\Bundle\WebServerBundle;
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);
}
}

View File

@ -13,6 +13,8 @@ namespace Symfony\Bundle\WebServerBundle;
/**
* @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
{