diff --git a/src/Command/Site/InstallCommand.php b/src/Command/Site/InstallCommand.php index 8d627d0..ddc0d2e 100644 --- a/src/Command/Site/InstallCommand.php +++ b/src/Command/Site/InstallCommand.php @@ -196,11 +196,9 @@ protected function interact(InputInterface $input, OutputInterface $output) // --db-url option $db_url = $input->getOption('db-url'); $valuesFromUrl = parse_url($db_url); - var_dump($valuesFromUrl); // --db-host option $dbHost = $db_url?$valuesFromUrl['host']:$input->getOption('db-host'); - var_dump($dbHost); if (!$dbHost) { $dbHost = $this->dbHostQuestion(); } @@ -305,6 +303,16 @@ protected function execute(InputInterface $input, OutputInterface $output) $dbPrefix = $input->getOption('db-prefix'); $force = $input->getOption('force'); + //Check if there is a url to db connection + $db_url = $input->getOption('db-url'); + if ($db_url) { + $valuesFromUrl = parse_url($db_url); + $dbHost = $valuesFromUrl['host']; + $dbName = ltrim($valuesFromUrl['path'], "/"); + $dbUser = $valuesFromUrl['user']; + $dbPass = $valuesFromUrl['pass']; + } + $configParameters = array( 'dbhost' => $dbHost, 'dbname' => $dbName, @@ -326,6 +334,8 @@ protected function execute(InputInterface $input, OutputInterface $output) ); + + $this->generator->generate( $this->appRoot, $force,