本文整理汇总了PHP中N98\Util\Console\Helper\Table\Renderer\RendererFactory类的典型用法代码示例。如果您正苦于以下问题:PHP RendererFactory类的具体用法?PHP RendererFactory怎么用?PHP RendererFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RendererFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: creation
/**
* @test
*/
public function creation()
{
$renderer = new XmlRenderer();
$this->assertInstanceOf(__NAMESPACE__ . '\\XmlRenderer', $renderer);
$renderFactory = new RendererFactory();
$renderer = $renderFactory->create('xml');
$this->assertInstanceOf(__NAMESPACE__ . '\\XmlRenderer', $renderer);
}
示例2: renderByFormat
/**
* @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);
}
}
示例3: configure
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);
}
示例4: configure
protected function configure()
{
$this->setName('customer:list')->setDescription('Lists all magento customers')->addArgument('search', InputArgument::OPTIONAL, 'Search query')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']');
$help = <<<HELP
Lists all Magento Customers of current installation.
HELP;
$this->setHelp($help);
}
示例5: configure
protected function configure()
{
$this->setName('index:list')->setDescription('Lists all magento indexes')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']');
$help = <<<HELP
Lists all Magento indexers of current installation.
HELP;
$this->setHelp($help);
}
示例6: configure
protected function configure()
{
$this->setName('sys:setup:compare-versions')->addOption('ignore-data', null, InputOption::VALUE_NONE, 'Ignore data updates')->addOption('log-junit', null, InputOption::VALUE_REQUIRED, 'Log output to a JUnit xml file.')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']')->setDescription('Compare module version with core_resource table.');
$help = <<<HELP
Compares module version with saved setup version in `core_resource` table and displays version mismatch.
HELP;
$this->setHelp($help);
}
示例7: configure
/**
* Setup
*
* @return void
*/
protected function configure()
{
$this->setName('giftcard:info')->addArgument('code', \Symfony\Component\Console\Input\InputArgument::REQUIRED, 'Gift card code')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']')->setDescription('Get gift card account information by code');
$help = <<<HELP
Get gift card account information by code
HELP;
$this->setHelp($help);
}
示例8: configure
protected function configure()
{
$this->setName('extension:list')->setAliases(array('extension:search'))->addArgument('search', InputArgument::OPTIONAL, 'Search string')->setDescription('List magento connection extensions')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']');
$help = <<<HELP
* Requires Magento's `mage` shell script.
* Does not work with Windows as operating system.
HELP;
$this->setHelp($help);
}
示例9: configure
protected function configure()
{
$this->setName('customer:list')->addArgument('search', InputArgument::OPTIONAL, 'Search query')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']')->setDescription('Lists customers');
$help = <<<HELP
List customers. The output is limited to 1000 (can be changed by overriding config).
If search parameter is given the customers are filtered (searchs in firstname, lastname and email).
HELP;
$this->setHelp($help);
}
示例10: configure
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);
}
示例11: configure
protected function configure()
{
$this->setName('sys:check')->setDescription('Checks Magento 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);
}
示例12: configure
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/n98-magerun/scripts* or in your home dir
in folder *<HOME>/.n98-magerun/scripts*.
Scripts must have the file extension *.magerun*.
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.
\$ n98-magerun.phar script:repo:list
HELP;
$this->setHelp($help);
}
示例13: configure
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('magerun-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);
}
示例14: configure
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);
}
示例15: configure
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('add-backend', null, InputOption::VALUE_NONE, 'Add backend type to list')->addOption('format', null, InputOption::VALUE_OPTIONAL, 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']');
}