SqlImportCommand.php in MongoDB 8.2
File
modules/mongodb_storage/src/Command/SqlImportCommand.php
View source
<?php
declare (strict_types=1);
namespace Drupal\mongodb_storage\Command;
use Drupal\Console\Annotations\DrupalCommand;
use Drupal\Console\Core\Command\ContainerAwareCommand;
use Drupal\mongodb_storage\Install\SqlImport;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SqlImportCommand extends ContainerAwareCommand {
protected $sqlImport;
public function __construct(SqlImport $sqlImport) {
parent::__construct();
$this->sqlImport = $sqlImport;
}
protected function configure() {
$name = 'commands.mongodb.storage.import_keyvalue';
$this
->setName('mongodb:storage:import_keyvalue')
->setDescription($this
->trans("{$name}.description"))
->setHelp($this
->trans("{$name}.help"))
->setAliases([
'mdbsikv',
'most-ikv',
]);
}
protected function execute(InputInterface $input, OutputInterface $output) {
$out = $this->sqlImport
->import();
$this
->getIo()
->writeln($out);
}
}
Classes
Name |
Description |
SqlImportCommand |
Provides the commands.mongodb.storage.import_keyvalue console command. |