Dimension
6 years ago
API.php
6 years ago
AggregatedMetric.php
6 years ago
ArchivedMetric.php
6 years ago
Archiver.php
6 years ago
Categories.php
6 years ago
ComponentFactory.php
6 years ago
ComputedMetric.php
6 years ago
ConsoleCommand.php
6 years ago
Controller.php
6 years ago
ControllerAdmin.php
6 years ago
Dependency.php
6 years ago
LogTablesProvider.php
6 years ago
Manager.php
6 years ago
Menu.php
6 years ago
MetadataLoader.php
6 years ago
Metric.php
6 years ago
PluginException.php
6 years ago
ProcessedMetric.php
6 years ago
ReleaseChannels.php
6 years ago
Report.php
6 years ago
ReportsProvider.php
6 years ago
RequestProcessors.php
6 years ago
Segment.php
6 years ago
SettingsProvider.php
6 years ago
Tasks.php
6 years ago
ThemeStyles.php
6 years ago
ViewDataTable.php
6 years ago
Visualization.php
6 years ago
WidgetsProvider.php
6 years ago
ConsoleCommand.php
47 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Piwik - free/libre analytics platform |
| 4 | * |
| 5 | * @link https://matomo.org |
| 6 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 7 | * |
| 8 | */ |
| 9 | namespace Piwik\Plugin; |
| 10 | |
| 11 | use Symfony\Component\Console\Command\Command as SymfonyCommand; |
| 12 | use Symfony\Component\Console\Input\InputInterface; |
| 13 | use Symfony\Component\Console\Output\OutputInterface; |
| 14 | |
| 15 | /** |
| 16 | * The base class for console commands. |
| 17 | * |
| 18 | * @api |
| 19 | */ |
| 20 | class ConsoleCommand extends SymfonyCommand |
| 21 | { |
| 22 | public function writeSuccessMessage(OutputInterface $output, $messages) |
| 23 | { |
| 24 | $output->writeln(''); |
| 25 | |
| 26 | foreach ($messages as $message) { |
| 27 | $output->writeln('<info>' . $message . '</info>'); |
| 28 | } |
| 29 | |
| 30 | $output->writeln(''); |
| 31 | } |
| 32 | |
| 33 | protected function checkAllRequiredOptionsAreNotEmpty(InputInterface $input) |
| 34 | { |
| 35 | $options = $this->getDefinition()->getOptions(); |
| 36 | |
| 37 | foreach ($options as $option) { |
| 38 | $name = $option->getName(); |
| 39 | $value = $input->getOption($name); |
| 40 | |
| 41 | if ($option->isValueRequired() && empty($value)) { |
| 42 | throw new \InvalidArgumentException(sprintf('The required option --%s is not set', $name)); |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 |