Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/contao-community-alliance/console
Console application for Contao Open Source CMS
https://github.com/contao-community-alliance/console
Last synced: about 1 month ago
JSON representation
Console application for Contao Open Source CMS
- Host: GitHub
- URL: https://github.com/contao-community-alliance/console
- Owner: contao-community-alliance
- Created: 2014-02-12T16:07:23.000Z (almost 11 years ago)
- Default Branch: develop
- Last Pushed: 2014-06-06T05:42:52.000Z (over 10 years ago)
- Last Synced: 2024-04-26T08:21:59.882Z (8 months ago)
- Language: PHP
- Size: 160 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Console Integration
===================Register you console command classes in `$GLOBALS['CONSOLE_CMD']` within your `config.php`.
**config.php**
```php
setName('demo:greet')
->setDescription('Greet someone')
->addArgument(
'name',
InputArgument::OPTIONAL,
'Who do you want to greet?'
)
->addOption(
'yell',
null,
InputOption::VALUE_NONE,
'If set, the task will yell in uppercase letters'
)
;
}protected function execute(InputInterface $input, OutputInterface $output)
{
$name = $input->getArgument('name');
if ($name) {
$text = 'Hello '.$name;
} else {
$text = 'Hello';
}if ($input->getOption('yell')) {
$text = strtoupper($text);
}$output->writeln($text);
}
}
```If you need a more complex setup routine, use the `initializeConsole` hook.
**config.php**
```php
add(new GreetCommand());
}
}
```For details see http://symfony.com/doc/2.3/components/console/introduction.html