[FrameworkBundle] removed unnecessary DebugCommand

This commit is contained in:
kbond 2011-09-15 10:46:01 -04:00 committed by Kevin Bond
parent fa32885ea3
commit df94282dab
3 changed files with 3 additions and 50 deletions

View File

@ -27,7 +27,7 @@ use Symfony\Component\Config\Definition\BooleanNode;
*
* @author Kevin Bond <kevinbond@gmail.com>
*/
class ConfigDumpCommand extends DebugCommand
class ConfigDumpCommand extends ContainerDebugCommand
{
protected $output;

View File

@ -27,7 +27,7 @@ use Symfony\Component\Config\FileLocator;
*
* @author Ryan Weaver <ryan@thatsquality.com>
*/
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.'));

View File

@ -1,47 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* 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 <kevinbond@gmail.com>
*/
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;
}
}