X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FDebug%2FRolesCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FDebug%2FRolesCommand.php;h=c1b1d53b7e8ace585000a1078cd02fd2dd06d114;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/drupal/console/src/Command/Debug/RolesCommand.php b/vendor/drupal/console/src/Command/Debug/RolesCommand.php new file mode 100644 index 000000000..c1b1d53b7 --- /dev/null +++ b/vendor/drupal/console/src/Command/Debug/RolesCommand.php @@ -0,0 +1,72 @@ +drupalApi = $drupalApi; + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('debug:roles') + ->setDescription($this->trans('commands.debug.roles.description')) + ->setAliases(['dusr']); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $roles = $this->drupalApi->getRoles(); + + $tableHeader = [ + $this->trans('commands.debug.roles.messages.role-id'), + $this->trans('commands.debug.roles.messages.role-name'), + ]; + + $tableRows = []; + foreach ($roles as $roleId => $role) { + $tableRows[] = [ + $roleId, + $role + ]; + } + + $this->getIo()->table($tableHeader, $tableRows); + } +}