diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php index 02e2056a6d654..0ba7203db2430 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php @@ -55,6 +55,14 @@ public function getKernel() return $this->kernel; } + /** + * @see Symfony\Contracts\Service\ResetInterface + */ + public function reset() + { + $this->kernel->reset(); + } + /** * Runs the current application. * diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index e6532861215ab..a22be50d25fd2 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -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. @@ -47,7 +48,7 @@ * * @author Fabien Potencier */ -abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface +abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface, ResetInterface { /** * @var BundleInterface[] @@ -150,6 +151,13 @@ public function reboot($warmupDir) $this->boot(); } + public function reset() + { + if ($this->container->has('services_resetter')) { + $this->container->get('services_resetter')->reset(); + } + } + /** * {@inheritdoc} */