Skip to content

Commit

Permalink
Don't break installation if no SQLite is present
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Nov 2, 2020
1 parent b7317e3 commit d254315
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/Command/InfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,22 @@ protected function execute(InputInterface $input, OutputInterface $output)

$io->text([$message, '']);

$platform = $this->doctrineVersion->getPlatform();
try {
$platform = $this->doctrineVersion->getPlatform();
$tableExists = $this->doctrineVersion->tableContentExists() ? '' : sprintf(' - <error>Tables not initialised</error>');
$withJson = $this->doctrineVersion->hasJson() ? 'with JSON' : 'without JSON';
} catch (\Throwable $e) {
$platform = [
'client_version' => '',
'driver_name' => '<error>Unknown - no database connection</error>',
'connection_status' => '',
'server_version' => '',
];
$tableExists = '';
$withJson = '';
}

$connection = ! empty($platform['connection_status']) ? sprintf(' - <comment>%s</comment>', $platform['connection_status']) : '';
$tableExists = $this->doctrineVersion->tableContentExists() ? '' : sprintf(' - <error>Tables not initialised</error>');
$withJson = $this->doctrineVersion->hasJson() ? 'with JSON' : 'without JSON';

$io->listing([
sprintf('Install type: <info>%s</info>', Version::installType()),
Expand Down

0 comments on commit d254315

Please sign in to comment.