Skip to content

Commit

Permalink
[HttpKernel+FrameworkBundle] Added Kernel::reset() and Console\Applic…
Browse files Browse the repository at this point in the history
…ation::reset()
  • Loading branch information
lyrixx committed Jul 8, 2019
1 parent 6811aaa commit fa26c2d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Expand Up @@ -9,6 +9,7 @@ CHANGELOG
* Deprecated the `controller_name_converter` and `resolve_controller_name_subscriber` services
* The `ControllerResolver` and `DelegatingLoader` classes have been marked as `final`
* Added support for configuring chained cache pools
* `Application` implements `ResetInterface`

4.3.0
-----
Expand All @@ -34,8 +35,8 @@ CHANGELOG
options if you're using Symfony's serializer.
* [BC Break] Removed the `framework.messenger.routing.send_and_handle` configuration.
Instead of setting it to true, configure a `SyncTransport` and route messages to it.
* Added information about deprecated aliases in `debug:autowiring`
* Added php ini session options `sid_length` and `sid_bits_per_character`
* Added information about deprecated aliases in `debug:autowiring`
* Added php ini session options `sid_length` and `sid_bits_per_character`
to the `session` section of the configuration
* Added support for Translator paths, Twig paths in translation commands.
* Added support for PHP files with translations in translation commands.
Expand Down
11 changes: 10 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Expand Up @@ -24,11 +24,12 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Contracts\Service\ResetInterface;

/**
* @author Fabien Potencier <fabien@symfony.com>
*/
class Application extends BaseApplication
class Application extends BaseApplication implements ResetInterface
{
private $kernel;
private $commandsRegistered = false;
Expand All @@ -55,6 +56,14 @@ public function getKernel()
return $this->kernel;
}

/**
* {@inheritdoc}
*/
public function reset()
{
$this->kernel->reset();
}

/**
* Runs the current application.
*
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/composer.json
Expand Up @@ -20,6 +20,7 @@
"ext-xml": "*",
"symfony/cache": "^4.4|^5.0",
"symfony/config": "^4.2|^5.0",
"symfony/contracts": "~1.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/error-catcher": "^4.4|^5.0",
"symfony/http-foundation": "^4.3|^5.0",
Expand Down
5 changes: 3 additions & 2 deletions src/Symfony/Component/HttpKernel/CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
-----

* The `DebugHandlersListener` class has been marked as `final`
* `HttpKernel` implements `ResetInterface`

4.3.0
-----
Expand Down Expand Up @@ -36,8 +37,8 @@ CHANGELOG

* deprecated `KernelInterface::getRootDir()` and the `kernel.root_dir` parameter
* deprecated `KernelInterface::getName()` and the `kernel.name` parameter
* deprecated the first and second constructor argument of `ConfigDataCollector`
* deprecated `ConfigDataCollector::getApplicationName()`
* deprecated the first and second constructor argument of `ConfigDataCollector`
* deprecated `ConfigDataCollector::getApplicationName()`
* deprecated `ConfigDataCollector::getApplicationVersion()`

4.1.0
Expand Down
13 changes: 12 additions & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -36,6 +36,7 @@
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
use Symfony\Contracts\Service\ResetInterface;

/**
* The Kernel is the heart of the Symfony system.
Expand All @@ -47,7 +48,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface
abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface, ResetInterface
{
/**
* @var BundleInterface[]
Expand Down Expand Up @@ -150,6 +151,16 @@ public function reboot($warmupDir)
$this->boot();
}

/**
* {@inheritdoc}
*/
public function reset()
{
if ($this->container->has('services_resetter')) {
$this->container->get('services_resetter')->reset();
}
}

/**
* {@inheritdoc}
*/
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/composer.json
Expand Up @@ -17,6 +17,7 @@
],
"require": {
"php": "^7.1.3",
"symfony/contracts": "~1.0",
"symfony/error-catcher": "^4.4|^5.0",
"symfony/event-dispatcher": "^4.3",
"symfony/http-foundation": "^4.4|^5.0",
Expand Down

0 comments on commit fa26c2d

Please sign in to comment.