Skip to content
Permalink
Browse files

[site:install] Change dbFile if the installation is a multisite (#4056)

  • Loading branch information...
harold20 authored and enzolutions committed May 22, 2019
1 parent 3c23a09 commit 813ad2468b9dcb3476b2df2ca8d22509400248cb
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/Command/Site/InstallCommand.php
@@ -279,9 +279,11 @@ function ($profile) {
if ($dbType === 'sqlite') {
// --db-file option
if (!$input->getOption('db-file')) {
$uri = parse_url($input->getParameterOption(['--uri', '-l'], 'default'), PHP_URL_HOST);
$uriPath = $this->site->multisiteMode($uri) ? $this->site->getMultisiteDir($uri) : 'default';
$dbFile = $this->getIo()->ask(
$this->trans('commands.migrate.execute.questions.db-file'),
'sites/default/files/.ht.sqlite'
'sites/'.$uriPath.'/files/.ht.sqlite'
);
$input->setOption('db-file', $dbFile);
}
@@ -419,7 +421,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
];
if ($database_install['driver'] === 'sqlite') {
$database_install['database'] = $input->getOption('db-file');
$uriPath = $this->site->multisiteMode($uri) ? $this->site->getMultisiteDir($uri) : 'default';
$dbFile = $input->getOption('db-file')?:'sites/'.$uriPath.'/files/.ht.sqlite';
$database_install['database'] = $dbFile;
unset(
$database_install['username'],
$database_install['password'],

0 comments on commit 813ad24

Please sign in to comment.
You can’t perform that action at this time.