/** * @param OutputInterface $outputInterface * @param array $rows * @param string $format */ public function renderByFormat(OutputInterface $outputInterface, array $rows, $format = '') { $rendererFactory = new RendererFactory(); $renderer = $rendererFactory->create($format); if ($renderer && $renderer instanceof RendererInterface) { foreach ($rows as &$row) { $row = array_combine($this->headers, $row); } $renderer->render($outputInterface, $rows); } else { $this->setRows($rows); $this->render($outputInterface); } }
protected function configure() { $help = <<<'HELP' <comment>TYPE OPTIONS</comment> <info>QUICK</info> Do not scan the rows to check for incorrect links. Applies to InnoDB and MyISAM tables and views. <info>FAST</info> Check only tables that have not been closed properly. Applies only to MyISAM tables and views; ignored for InnoDB. <info>CHANGED</info> Check only tables that have been changed since the last check or that have not been closed properly. Applies only to MyISAM tables and views; ignored for InnoDB. <info>MEDIUM</info> Scan rows to verify that deleted links are valid. This also calculates a key checksum for the rows and verifies this with a calculated checksum for the keys. Applies only to MyISAM tables and views; ignored for InnoDB. <info>EXTENDED</info> Do a full key lookup for all keys for each row. This ensures that the table is 100% consistent, but takes a long time. Applies only to MyISAM tables and views; ignored for InnoDB. <comment>InnoDB</comment> InnoDB tables will be optimized with the ALTER TABLE ... ENGINE=InnoDB statement. The options above do not apply to them. HELP; $this->setName('db:maintain:check-tables')->setDescription('Check database tables')->addOption('type', null, InputOption::VALUE_OPTIONAL, 'Check type (one of QUICK, FAST, MEDIUM, EXTENDED, CHANGED)', 'MEDIUM')->addOption('repair', null, InputOption::VALUE_NONE, 'Repair tables (only MyISAM)')->addOption('table', null, InputOption::VALUE_OPTIONAL, 'Process only given table (wildcards are supported)')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']')->setHelp($help); }
protected function configure() { $this->setName('index:list')->setDescription('Lists all contao indexes')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); $help = <<<HELP Lists all Contao indexers of current installation. HELP; $this->setHelp($help); }
protected function configure() { $this->setName('extension:list')->setAliases(array('extension:search'))->addArgument('search', InputArgument::OPTIONAL, 'Search string')->setDescription('List contao connection extensions')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); $help = <<<HELP * Requires Contao's `mage` shell script. * Does not work with Windows as operating system. HELP; $this->setHelp($help); }
protected function configure() { $this->setName('db:info')->addArgument('setting', InputArgument::OPTIONAL, 'Only output value of named setting')->addDeprecatedAlias('database:info', 'Please use db:info')->setDescription('Dumps database informations')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); $help = <<<HELP This command is useful to print all informations about the current configured database in app/etc/local.xml. It can print connection string for JDBC, PDO connections. HELP; $this->setHelp($help); }
protected function configure() { $this->setName('sys:check')->setDescription('Checks Contao System')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); $help = <<<HELP - Checks missing files and folders - Security - PHP Extensions (Required and Bytecode Cache) - MySQL InnoDB Engine HELP; $this->setHelp($help); }
protected function configure() { $this->setName('config:get')->setDescription('Get a core config item')->setHelp(<<<EOT If <info>path</info> is not set, all available config items will be listed. The <info>path</info> may contain wildcards (*). If <info>path</info> ends with a trailing slash, all child items will be listed. E.g. config:get web/ is the same as config:get web/* EOT )->addArgument('path', InputArgument::OPTIONAL, 'The config path')->addOption('scope', null, InputOption::VALUE_REQUIRED, 'The config value\'s scope')->addOption('scope-id', null, InputOption::VALUE_REQUIRED, 'The config value\'s scope ID')->addOption('decrypt', null, InputOption::VALUE_NONE, 'Decrypt the config value using local.xml\'s crypt key')->addOption('update-script', null, InputOption::VALUE_NONE, 'Output as update script lines')->addOption('conrun-script', null, InputOption::VALUE_NONE, 'Output for usage with config:set')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); $help = <<<HELP If path is not set, all available config items will be listed. path may contain wildcards (*) HELP; $this->setHelp($help); }
protected function configure() { $this->setName('script:repo:list')->setDescription('Lists all scripts in repository')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); $help = <<<HELP You can organize your scripts in a repository. Simply place a script in folder */usr/local/share/imi-conrun/scripts* or in your home dir in folder *<HOME>/.imi-conrun/scripts*. Scripts must have the file extension *.conrun*. After that you can list all scripts with the *script:repo:list* command. The first line of the script can contain a comment (line prefixed with #) which will be displayed as description. \$ imi-conrun.phar script:repo:list HELP; $this->setHelp($help); }
protected function configure() { $help = <<<HELP Supported Locales: - cs_CZ - ru_RU - bg_BG - en_US - it_IT - sr_RS - sr_Cyrl_RS - sr_Latn_RS - pl_PL - en_GB - de_DE - sk_SK - fr_FR - es_AR - de_AT HELP; $this->setName('customer:create:dummy')->addArgument('count', InputArgument::REQUIRED, 'Count')->addArgument('locale', InputArgument::REQUIRED, 'Locale')->addArgument('website', InputArgument::OPTIONAL, 'Website')->addOption('with-addresses', null, InputOption::VALUE_NONE, 'Create dummy billing/shipping addresses for each customers')->setDescription('Generate dummy customers. You can specify a count and a locale.')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']')->setHelp($help); }
protected function configure() { $this->setName('sys:cron:history')->setDescription('Last executed cronjobs with status.')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('sys:website:list')->setDescription('Lists all websites')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('eav:attribute:list')->setDescription('Lists all EAV attributes')->addOption('filter-type', null, InputOption::VALUE_OPTIONAL, 'Filter attributes by entity type')->addOption('add-source', null, InputOption::VALUE_NONE, 'Add source models to list')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('customer:create')->addArgument('email', InputArgument::OPTIONAL, 'Email')->addArgument('password', InputArgument::OPTIONAL, 'Password')->addArgument('firstname', InputArgument::OPTIONAL, 'Firstname')->addArgument('lastname', InputArgument::OPTIONAL, 'Lastname')->addArgument('website', InputArgument::OPTIONAL, 'Website')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']')->setDescription('Creates a new customer/user for shop frontend.'); }
protected function configure() { $this->setName('dev:module:list')->addOption('codepool', null, InputOption::VALUE_OPTIONAL, 'Show modules in a specific codepool')->addOption('status', null, InputOption::VALUE_OPTIONAL, 'Show modules with a specific status')->addOption('vendor', null, InputOption::VALUE_OPTIONAL, 'Show modules of a specified vendor')->setAliases(array('sys:modules:list'))->setDescription('List all installed modules')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('eav:attribute:view')->addArgument('entityType', InputArgument::REQUIRED, 'Entity Type Code like catalog_product')->addArgument('attributeCode', InputArgument::REQUIRED, 'Attribute Code')->setDescription('View informations about an EAV attribute')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('dev:module:dependencies:on')->addArgument('moduleName', InputArgument::REQUIRED, 'Module to show dependencies')->addOption('all', 'a', InputOption::VALUE_NONE, 'Show all dependencies (dependencies of dependencies)')->setDescription('Show list of modules which given module depends on')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
/** * Configure command */ protected function configure() { $this->setName(static::COMMAND_NAME)->addArgument('moduleName', InputArgument::REQUIRED, 'Module to show dependencies')->addOption('all', 'a', InputOption::VALUE_NONE, 'Show all dependencies (dependencies of dependencies)')->setDescription(static::COMMAND_DESCRIPTION)->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('cache:report')->setDescription('View inside the cache')->addOption('tags', 't', InputOption::VALUE_NONE, 'Output tags')->addOption('mtime', 'm', InputOption::VALUE_NONE, 'Output last modification time')->addOption('filter-id', '', InputOption::VALUE_OPTIONAL, 'Filter output by ID (substring)')->addOption('filter-tag', '', InputOption::VALUE_OPTIONAL, 'Filter output by TAG (seperate multiple tags by comma)')->addOption('fpc', null, InputOption::VALUE_NONE, 'Use full page cache instead of core cache (Enterprise only!)')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('sys:info')->setDescription('Prints infos about the current contao system.')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->setName('dev:module:observer:list')->addArgument('type', InputArgument::OPTIONAL, 'Observer type (global, admin, frontend)')->setDescription('Lists all registered observers')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'); }
protected function configure() { $this->addArgument('search', InputArgument::OPTIONAL, 'Only output variables of specified name. The wildcard % is supported!')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']')->addOption('rounding', null, InputOption::VALUE_OPTIONAL, 'Amount of decimals to display. If -1 then disabled', 0)->addOption('no-description', null, InputOption::VALUE_NONE, 'Disable description'); }