5 * Contains \Drupal\Console\Core\Command\Exclude\DrupliconCommand.
8 namespace Drupal\Console\Core\Command\Exclude;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Symfony\Component\Finder\Finder;
13 use Drupal\Console\Core\Command\Command;
14 use Drupal\Console\Core\Utils\TwigRenderer;
15 use Drupal\Console\Core\Utils\ConfigurationManager;
18 * Class DrupliconCommand
20 * @package Drupal\Console\Core\Command\Exclude
22 class DrupliconCommand extends Command
35 * @var ConfigurationManager
37 protected $configurationManager;
40 * DrupliconCommand constructor.
42 * @param string $appRoot
43 * @param TwigRenderer $renderer
44 * @param ConfigurationManager $configurationManager
46 public function __construct(
48 TwigRenderer $renderer,
49 ConfigurationManager $configurationManager
51 $this->appRoot = $appRoot;
52 $this->renderer = $renderer;
53 $this->configurationManager = $configurationManager;
54 parent::__construct();
60 protected function configure()
63 ->setName('druplicon')
64 ->setDescription($this->trans('application.commands.druplicon.description'));
70 protected function execute(InputInterface $input, OutputInterface $output)
73 '%s/templates/core/druplicon/',
74 $this->configurationManager->getVendorCoreRoot()
77 $finder = new Finder();
83 foreach ($finder as $template) {
84 $templates[] = $template->getRelativePathname();
87 $druplicon = $this->renderer->render(
90 $templates[array_rand($templates)]
94 $this->getIo()->writeln($druplicon);