protected DbImportCommand::runScript(Connection $connection, $script)
Run the database script.
Parameters
\Drupal\Core\Database\Connection $connection: Connection used by the script when included.
string $script: Path to dump script.
File
- core/lib/Drupal/Core/Command/DbImportCommand.php, line 55
Class
- DbImportCommand
- Provides a command to import the current database from a script.
Namespace
Drupal\Core\Command
Code
protected function runScript(Connection $connection, $script) { $old_key = Database::setActiveConnection($connection->getKey()); if (substr($script, -3) == '.gz') { $script = "compress.zlib://$script"; } try { require $script; } catch (SchemaObjectExistsException $e) { throw new \RuntimeException('An existing Drupal installation exists at this location. Try removing all tables or changing the database prefix in your settings.php file.'); } Database::setActiveConnection($old_key); }
Please login to continue.