protected function ExportCommand::execute in Devel 8.2
Same name and namespace in other branches
- 8.3 webprofiler/src/Command/ExportCommand.php \Drupal\webprofiler\Command\ExportCommand::execute()
- 8 webprofiler/src/Command/ExportCommand.php \Drupal\webprofiler\Command\ExportCommand::execute()
- 4.x webprofiler/src/Command/ExportCommand.php \Drupal\webprofiler\Command\ExportCommand::execute()
File
- webprofiler/
src/ Command/ ExportCommand.php, line 45
Class
- ExportCommand
- Class ExportCommand
Namespace
Drupal\webprofiler\CommandCode
protected function execute(InputInterface $input, OutputInterface $output) {
$id = $input
->getArgument('id');
$directory = $input
->getOption('directory');
/** @var \Drupal\webprofiler\Profiler\Profiler $profiler */
$profiler = $this->container
->get('profiler');
try {
if ($id) {
$this->filename = $this
->exportSingle($profiler, $id, $directory);
}
else {
$this->filename = $this
->exportAll($profiler, $directory, $output);
}
} catch (\Exception $e) {
$output
->writeln('<error>' . $e
->getMessage() . '</error>');
}
}