protected function DbImportCommand::execute in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Command/DbImportCommand.php \Drupal\Core\Command\DbImportCommand::execute()
File
- core/
lib/ Drupal/ Core/ Command/ DbImportCommand.php, line 35
Class
- DbImportCommand
- Provides a command to import the current database from a script.
Namespace
Drupal\Core\CommandCode
protected function execute(InputInterface $input, OutputInterface $output) {
$script = $input
->getArgument('script');
if (!is_file($script)) {
$output
->writeln('File must exist.');
return 1;
}
$connection = $this
->getDatabaseConnection($input);
$this
->runScript($connection, $script);
$output
->writeln('Import completed successfully.');
return 0;
}