Skip to content

Commit

Permalink
3380 relocate debug commands (#3398)
Browse files Browse the repository at this point in the history
* Move theme:debug to debug:theme

* Move theme:debug to debug:theme

* Move router:debug to debug:router

* Move queue:debug to debug:queue

* Move libraries:debug to debug:libraries

* Move module:debug to debug:module

* Move image:styles:debug to debug:image:styles
  • Loading branch information
mauhg authored and jmolivas committed Jul 5, 2017
1 parent 424cad6 commit b6ad187
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 106 deletions.
30 changes: 30 additions & 0 deletions config/services/drupal-console/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,33 @@ services:
arguments: ['@state', '@keyvalue']
tags:
- { name: drupal.command }
console.theme_debug:
class: Drupal\Console\Command\Debug\ThemeCommand
arguments: ['@config.factory', '@theme_handler']
tags:
- { name: drupal.command }
console.router_debug:
class: Drupal\Console\Command\Debug\RouterCommand
arguments: ['@router.route_provider']
tags:
- { name: drupal.command }
console.queue_debug:
class: Drupal\Console\Command\Debug\QueueCommand
arguments: ['@plugin.manager.queue_worker']
tags:
- { name: drupal.command }
console.libraries_debug:
class: Drupal\Console\Command\Debug\LibrariesCommand
arguments: ['@module_handler', '@theme_handler', '@library.discovery', '@app.root']
tags:
- { name: drupal.command }
console.module_debug:
class: Drupal\Console\Command\Debug\ModuleCommand
arguments: ['@console.configuration_manager', '@console.site', '@http_client']
tags:
- { name: drupal.command }
console.image_styles_debug:
class: Drupal\Console\Command\Debug\ImageStylesCommand
arguments: ['@entity_type.manager']
tags:
- { name: drupal.command }
5 changes: 0 additions & 5 deletions config/services/drupal-console/image.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
services:
console.image_styles_debug:
class: Drupal\Console\Command\Image\StylesDebugCommand
arguments: ['@entity_type.manager']
tags:
- { name: drupal.command }
console.image_styles_flush:
class: Drupal\Console\Command\Image\StylesFlushCommand
arguments: ['@entity_type.manager']
Expand Down
6 changes: 0 additions & 6 deletions config/services/drupal-console/libraries.yml

This file was deleted.

5 changes: 0 additions & 5 deletions config/services/drupal-console/module.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
services:
console.module_debug:
class: Drupal\Console\Command\Module\DebugCommand
arguments: ['@console.configuration_manager', '@console.site', '@http_client']
tags:
- { name: drupal.command }
console.module_dependency_install:
class: Drupal\Console\Command\Module\InstallDependencyCommand
arguments: ['@console.site', '@console.validator', '@module_installer', '@console.chain_queue']
Expand Down
5 changes: 0 additions & 5 deletions config/services/drupal-console/queue.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
services:
console.queue_debug:
class: Drupal\Console\Command\Queue\DebugCommand
arguments: ['@plugin.manager.queue_worker']
tags:
- { name: drupal.command }
console.queue_run:
class: Drupal\Console\Command\Queue\RunCommand
arguments: ['@plugin.manager.queue_worker', '@queue']
Expand Down
5 changes: 0 additions & 5 deletions config/services/drupal-console/router.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
services:
console.router_debug:
class: Drupal\Console\Command\Router\DebugCommand
arguments: ['@router.route_provider']
tags:
- { name: drupal.command }
console.router_rebuild:
class: Drupal\Console\Command\Router\RebuildCommand
arguments: ['@router.builder']
Expand Down
5 changes: 0 additions & 5 deletions config/services/drupal-console/theme.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
services:
console.theme_debug:
class: Drupal\Console\Command\Theme\DebugCommand
arguments: ['@config.factory', '@theme_handler']
tags:
- { name: drupal.command }
console.theme_download:
class: Drupal\Console\Command\Theme\DownloadCommand
arguments: ['@console.drupal_api', '@http_client', '@app.root']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Command\Image\StylesDebugCommand.
* Contains \Drupal\Console\Command\Debug\ImageStylesCommand.
*/

namespace Drupal\Console\Command\Image;
namespace Drupal\Console\Command\Debug;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -17,9 +17,9 @@
/**
* Class StylesDebugCommand
*
* @package Drupal\Console\Command\Image
* @package Drupal\Console\Command\Debug
*/
class StylesDebugCommand extends Command
class ImageStylesCommand extends Command
{
use CommandTrait;

Expand All @@ -29,7 +29,7 @@ class StylesDebugCommand extends Command
protected $entityTypeManager;

/**
* StylesDebugCommand constructor.
* ImageStylesCommand constructor.
*
* @param EntityTypeManagerInterface $entityTypeManager
*/
Expand All @@ -45,8 +45,8 @@ public function __construct(EntityTypeManagerInterface $entityTypeManager)
protected function configure()
{
$this
->setName('image:styles:debug')
->setDescription($this->trans('commands.image.styles.debug.description'));
->setName('debug:image:styles')
->setDescription($this->trans('commands.debug.image.styles.description'));
}

/**
Expand All @@ -60,7 +60,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

$io->newLine();
$io->comment(
$this->trans('commands.image.styles.debug.messages.styles-list')
$this->trans('commands.debug.image.styles.messages.styles-list')
);

if ($imageStyle) {
Expand All @@ -77,8 +77,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
protected function imageStyleList(DrupalStyle $io, $imageStyle)
{
$tableHeader = [
$this->trans('commands.image.styles.debug.messages.styles-name'),
$this->trans('commands.image.styles.debug.messages.styles-label')
$this->trans('commands.debug.image.styles.messages.styles-name'),
$this->trans('commands.debug.image.styles.messages.styles-label')
];

$tableRows = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Command\Libraries\DebugCommand.
* Contains \Drupal\Console\Command\Debug\LibrariesCommand.
*/

namespace Drupal\Console\Command\Libraries;
namespace Drupal\Console\Command\Debug;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -18,7 +18,7 @@
use Drupal\Console\Core\Command\Shared\CommandTrait;
use Drupal\Console\Core\Style\DrupalStyle;

class DebugCommand extends Command
class LibrariesCommand extends Command
{
use CommandTrait;

Expand Down Expand Up @@ -69,12 +69,12 @@ public function __construct(
protected function configure()
{
$this
->setName('libraries:debug')
->setDescription($this->trans('commands.libraries.debug.description'))
->setName('debug:libraries')
->setDescription($this->trans('commands.debug.libraries.description'))
->addArgument(
'group',
InputArgument::OPTIONAL,
$this->trans('commands.libraries.debug.options.name')
$this->trans('commands.debug.libraries.options.name')
);
}

Expand All @@ -90,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$groups = $this->getAllLibraries();

$tableHeader = [
$this->trans('commands.libraries.debug.messages.name'),
$this->trans('commands.debug.libraries.messages.name'),
];

$io->table($tableHeader, $groups, 'compact');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Command\Module\DebugCommand.
* Contains \Drupal\Console\Command\Debug\ModuleCommand.
*/

namespace Drupal\Console\Command\Module;
namespace Drupal\Console\Command\Debug;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -18,7 +18,7 @@
use GuzzleHttp\Client;
use Drupal\Console\Core\Utils\ConfigurationManager;

class DebugCommand extends Command
class ModuleCommand extends Command
{
use CommandTrait;

Expand Down Expand Up @@ -60,24 +60,24 @@ public function __construct(
protected function configure()
{
$this
->setName('module:debug')
->setDescription($this->trans('commands.module.debug.description'))
->setName('debug:module')
->setDescription($this->trans('commands.debug.module.description'))
->addArgument(
'module',
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
$this->trans('commands.module.debug.module')
$this->trans('commands.debug.module.module')
)
->addOption(
'status',
null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.module.debug.options.status')
$this->trans('commands.debug.module.options.status')
)
->addOption(
'type',
null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.module.debug.options.type')
$this->trans('commands.debug.module.options.type')
)
->setAliases(['mod']);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
} catch (\Exception $e) {
$io->error(
sprintf(
$this->trans('commands.module.debug.messages.no-results'),
$this->trans('commands.debug.module.messages.no-results'),
$module
)
);
Expand All @@ -127,17 +127,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
];

$tableRows[] = [
'<comment>'.$this->trans('commands.module.debug.messages.total-downloads').'</comment>',
'<comment>'.$this->trans('commands.debug.module.messages.total-downloads').'</comment>',
$data->package->downloads->total
];

$tableRows[] = [
'<comment>'.$this->trans('commands.module.debug.messages.total-monthly').'</comment>',
'<comment>'.$this->trans('commands.debug.module.messages.total-monthly').'</comment>',
$data->package->downloads->monthly
];

$tableRows[] = [
'<comment>'.$this->trans('commands.module.debug.messages.total-daily').'</comment>',
'<comment>'.$this->trans('commands.debug.module.messages.total-daily').'</comment>',
$data->package->downloads->daily
];

Expand All @@ -163,13 +163,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$tableHeader = [
$this->trans('commands.module.debug.messages.id'),
$this->trans('commands.module.debug.messages.name'),
$this->trans('commands.module.debug.messages.package'),
$this->trans('commands.module.debug.messages.version'),
$this->trans('commands.module.debug.messages.schema-version'),
$this->trans('commands.module.debug.messages.status'),
$this->trans('commands.module.debug.messages.origin'),
$this->trans('commands.debug.module.messages.id'),
$this->trans('commands.debug.module.messages.name'),
$this->trans('commands.debug.module.messages.package'),
$this->trans('commands.debug.module.messages.version'),
$this->trans('commands.debug.module.messages.schema-version'),
$this->trans('commands.debug.module.messages.status'),
$this->trans('commands.debug.module.messages.origin'),
];

$tableRows = [];
Expand All @@ -183,7 +183,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
continue;
}

$module_status = ($module->status) ? $this->trans('commands.module.debug.messages.installed') : $this->trans('commands.module.debug.messages.uninstalled');
$module_status = ($module->status) ? $this->trans('commands.debug.module.messages.installed') : $this->trans('commands.debug.module.messages.uninstalled');
$module_origin = ($module->origin) ? $module->origin : 'no core';
$schema_version = (drupal_get_installed_schema_version($module_id)!= -1?drupal_get_installed_schema_version($module_id): '');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Command\Queue\DebugCommand.
* Contains \Drupal\Console\Command\Debug\QueueCommand.
*/

namespace Drupal\Console\Command\Queue;
namespace Drupal\Console\Command\Debug;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -17,9 +17,9 @@
/**
* Class DebugCommand
*
* @package Drupal\Console\Command\Queue
* @package Drupal\Console\Command\Debug
*/
class DebugCommand extends Command
class QueueCommand extends Command
{
use CommandTrait;

Expand All @@ -45,8 +45,8 @@ public function __construct(QueueWorkerManagerInterface $queueWorker)
protected function configure()
{
$this
->setName('queue:debug')
->setDescription($this->trans('commands.queue.debug.description'));
->setName('debug:queue')
->setDescription($this->trans('commands.debug.queue.description'));
}

/**
Expand All @@ -57,9 +57,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io = new DrupalStyle($input, $output);

$tableHeader = [
$this->trans('commands.queue.debug.messages.queue'),
$this->trans('commands.queue.debug.messages.items'),
$this->trans('commands.queue.debug.messages.class')
$this->trans('commands.debug.queue.messages.queue'),
$this->trans('commands.debug.queue.messages.items'),
$this->trans('commands.debug.queue.messages.class')
];

$tableBody = $this->listQueues();
Expand Down
Loading

0 comments on commit b6ad187

Please sign in to comment.