Skip to content

Commit 3d1a6fa

Browse files
committed
[FrameworkBundle] Added Kernel::reset() and Console\Application::reset()
1 parent 6811aaa commit 3d1a6fa

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ public function getKernel()
5555
return $this->kernel;
5656
}
5757

58+
/**
59+
* @see Symfony\Contracts\Service\ResetInterface
60+
*/
61+
public function reset()
62+
{
63+
$this->kernel->reset();
64+
}
65+
5866
/**
5967
* Runs the current application.
6068
*

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use Symfony\Component\HttpKernel\Config\FileLocator;
3737
use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
3838
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
39+
use Symfony\Contracts\Service\ResetInterface;
3940

4041
/**
4142
* The Kernel is the heart of the Symfony system.
@@ -47,7 +48,7 @@
4748
*
4849
* @author Fabien Potencier <fabien@symfony.com>
4950
*/
50-
abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface
51+
abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface, ResetInterface
5152
{
5253
/**
5354
* @var BundleInterface[]
@@ -150,6 +151,13 @@ public function reboot($warmupDir)
150151
$this->boot();
151152
}
152153

154+
public function reset()
155+
{
156+
if ($this->container->has('services_resetter')) {
157+
$this->container->get('services_resetter')->reset();
158+
}
159+
}
160+
153161
/**
154162
* {@inheritdoc}
155163
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy