X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FSite%2FStatusCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FSite%2FStatusCommand.php;h=be38be1aa2120b3fbacb6b78cb8a10f0a085f107;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=c07a758dd1bb35c851c68de214bc2ce176f283dd;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/drupal/console/src/Command/Site/StatusCommand.php b/vendor/drupal/console/src/Command/Site/StatusCommand.php index c07a758dd..be38be1aa 100644 --- a/vendor/drupal/console/src/Command/Site/StatusCommand.php +++ b/vendor/drupal/console/src/Command/Site/StatusCommand.php @@ -10,10 +10,8 @@ namespace Drupal\Console\Command\Site; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Command\Command; +use Drupal\Console\Core\Command\ContainerAwareCommand; use Drupal\Core\Database\Database; -use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait; -use Drupal\Console\Core\Style\DrupalStyle; use Drupal\system\SystemManager; use Drupal\Core\Site\Settings; use Drupal\Core\Config\ConfigFactory; @@ -24,10 +22,8 @@ use Drupal\Core\Extension\ThemeHandler; * * @category site */ -class StatusCommand extends Command +class StatusCommand extends ContainerAwareCommand { - use ContainerAwareCommandTrait; - /* @var $connectionInfoKeys array */ protected $connectionInfoKeys = [ 'driver', @@ -80,7 +76,7 @@ class StatusCommand extends Command * @param $appRoot */ public function __construct( - SystemManager $systemManager, + SystemManager $systemManager = null, Settings $settings, ConfigFactory $configFactory, ThemeHandler $themeHandler, @@ -108,7 +104,8 @@ class StatusCommand extends Command InputOption::VALUE_OPTIONAL, $this->trans('commands.site.status.options.format'), 'table' - ); + ) + ->setAliases(['ss']); } /** @@ -119,8 +116,6 @@ class StatusCommand extends Command // Make sure all modules are loaded. $this->container->get('module_handler')->loadAll(); - $io = new DrupalStyle($input, $output); - $systemData = $this->getSystemData(); $connectionData = $this->getConnectionData(); $themeInfo = $this->getThemeData(); @@ -136,7 +131,7 @@ class StatusCommand extends Command $format = $input->getOption('format'); if ('table' === $format) { - $this->showDataAsTable($io, $siteData); + $this->showDataAsTable($siteData); } if ('json' === $format) { @@ -169,7 +164,7 @@ class StatusCommand extends Command } catch (\Exception $e) { $hashSalt = ''; } - $systemData['system'][$this->trans('commands.site.status.messages.hash_salt')] = $hashSalt; + $systemData['system'][$this->trans('commands.site.status.messages.hash-salt')] = $hashSalt; $systemData['system'][$this->trans('commands.site.status.messages.console')] = $this->getApplication()->getVersion(); } @@ -209,8 +204,8 @@ class StatusCommand extends Command return [ 'theme' => [ - 'theme_default' => $config->get('default'), - 'theme_admin' => $config->get('admin'), + $this->trans('commands.site.status.messages.theme_default') => $config->get('default'), + $this->trans('commands.site.status.messages.theme_admin') => $config->get('admin'), ], ]; } @@ -238,30 +233,30 @@ class StatusCommand extends Command return [ 'directory' => [ - $this->trans('commands.site.status.messages.directory_root') => $this->appRoot, - $this->trans('commands.site.status.messages.directory_temporary') => $systemFile->get('path.temporary'), - $this->trans('commands.site.status.messages.directory_theme_default') => $themeDefaultDirectory, - $this->trans('commands.site.status.messages.directory_theme_admin') => $themeAdminDirectory, + $this->trans('commands.site.status.messages.directory-root') => $this->appRoot, + $this->trans('commands.site.status.messages.directory-temporary') => $systemFile->get('path.temporary'), + $this->trans('commands.site.status.messages.directory-theme-default') => $themeDefaultDirectory, + $this->trans('commands.site.status.messages.directory-theme-admin') => $themeAdminDirectory, ], ]; } - protected function showDataAsTable(DrupalStyle $io, $siteData) + protected function showDataAsTable($siteData) { if (empty($siteData)) { return []; } - $io->newLine(); + $this->getIo()->newLine(); foreach ($this->groups as $group) { $tableRows = []; $groupData = $siteData[$group]; - $io->comment($this->trans('commands.site.status.messages.'.$group)); + $this->getIo()->comment($this->trans('commands.site.status.messages.'.$group)); foreach ($groupData as $key => $item) { $tableRows[] = [$key, $item]; } - $io->table([], $tableRows, 'compact'); + $this->getIo()->table([], $tableRows, 'compact'); } } }