X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FDevelop%2FGenerateDocCheatsheetCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FDevelop%2FGenerateDocCheatsheetCommand.php;h=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=474ab6e0ca878b5311aa9becdcbd0c5fd2dcb8b9;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/drupal/console/src/Command/Develop/GenerateDocCheatsheetCommand.php b/vendor/drupal/console/src/Command/Develop/GenerateDocCheatsheetCommand.php deleted file mode 100644 index 474ab6e0c..000000000 --- a/vendor/drupal/console/src/Command/Develop/GenerateDocCheatsheetCommand.php +++ /dev/null @@ -1,266 +0,0 @@ -setName('generate:doc:cheatsheet') - ->setDescription($this->trans('commands.generate.doc.cheatsheet.description')) - ->addOption( - 'path', - null, - InputOption::VALUE_OPTIONAL, - $this->trans('commands.generate.doc.cheatsheet.options.path') - ) - ->addOption( - 'wkhtmltopdf', - null, - InputOption::VALUE_OPTIONAL, - $this->trans('commands.generate.doc.cheatsheet.options.wkhtmltopdf') - ); - ; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new DrupalStyle($input, $output); - - $path = null; - - if ($input->hasOption('path')) { - $path = $input->getOption('path'); - } - - if (!$path) { - $io->error( - $this->trans('commands.generate.doc.gitbook.messages.missing_path') - ); - - return 1; - } - - // $wkhtmltopdfPath is overwritable by command option - - if ($input->getOption('wkhtmltopdf')) { - $this->wkhtmltopdfPath = $input->getOption('wkhtmltopdf'); - } - - $application = $this->getApplication(); - $command_list = []; - - foreach ($this->singleCommands as $single_command) { - $command = $application->find($single_command); - $command_list['none'][] = [ - 'name' => $command->getName(), - 'description' => $command->getDescription(), - ]; - } - - $namespaces = $application->getNamespaces(); - sort($namespaces); - - $namespaces = array_filter( - $namespaces, function ($item) { - return (strpos($item, ':')<=0); - } - ); - - foreach ($namespaces as $namespace) { - $commands = $application->all($namespace); - - usort( - $commands, function ($cmd1, $cmd2) { - return strcmp($cmd1->getName(), $cmd2->getName()); - } - ); - - foreach ($commands as $command) { - if ($command->getModule()=='Console') { - $command_list[$namespace][] = [ - 'name' => $command->getName(), - 'description' => $command->getDescription(), - ]; - } - } - } - - if (!empty($command_list)) { - $this->prepareHtml($command_list, $path, $io); - } - } - - - /** - * Generates (programatically, not with twig) the HTML to convert to PDF - * - * @param array $array_content - * @param string $path - */ - protected function prepareHtml($array_content, $path, $io) - { - $str = ''; - $str .= "
DrupalConsole Cheatsheet |