diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpCommand.php index c10cdd5a66..c9a69c8a07 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpCommand.php @@ -27,7 +27,7 @@ use Symfony\Component\Config\Definition\BooleanNode; * * @author Kevin Bond */ -class ConfigDumpCommand extends DebugCommand +class ConfigDumpCommand extends ContainerDebugCommand { protected $output; diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php index e252287d70..48d501526e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php @@ -27,7 +27,7 @@ use Symfony\Component\Config\FileLocator; * * @author Ryan Weaver */ -class ContainerDebugCommand extends DebugCommand +class ContainerDebugCommand extends ContainerAwareCommand { /** * @var ContainerBuilder @@ -183,7 +183,7 @@ EOF * * @return ContainerBuilder */ - private function getContainerBuilder() + protected function getContainerBuilder() { if (!$this->getApplication()->getKernel()->isDebug()) { throw new \LogicException(sprintf('Debug information about the container is only available in debug mode.')); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/DebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/DebugCommand.php deleted file mode 100644 index 5bfc8b41ad..0000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Command/DebugCommand.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Base command for debug tasks - * - * @author Kevin Bond - */ -abstract class DebugCommand extends ContainerAwareCommand -{ - /** - * Loads the ContainerBuilder from the cache. - * - * @return ContainerBuilder - */ - protected function getContainerBuilder() - { - if (!$this->getApplication()->getKernel()->isDebug()) { - throw new \LogicException(sprintf('Debug information about the container is only available in debug mode.')); - } - - if (!file_exists($cachedFile = $this->getContainer()->getParameter('debug.container.dump'))) { - throw new \LogicException(sprintf('Debug information about the container could not be found. Please clear the cache and try again.')); - } - - $container = new ContainerBuilder(); - - $loader = new XmlFileLoader($container, new FileLocator()); - $loader->load($cachedFile); - - return $container; - } -}