[FrameworkBundle] removed unnecessary DebugCommand
This commit is contained in:
parent
fa32885ea3
commit
df94282dab
@ -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;
|
||||
|
||||
|
@ -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.'));
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user