bolt / core

🧿 Bolt 5 core
https://boltcms.io
MIT License
547 stars 158 forks source link

Throw a more user friendly Error Exception when Database drivers are not installed #1453

Open nestordedios opened 4 years ago

nestordedios commented 4 years ago

I have created a fresh Bolt 4 project running composer create-project bolt/project myprojectname and when the script post-install-cm command php bin/console bolt:info is executed it throws an error when SQLite drivers are not installed.

bolt-info

Reproduction

Install a fresh Bolt 4 project running composer create-project bolt/project myprojectname in a server or dev environment without SQLite drivers installed.

Steps to reproduce

This is possible to reproduce when SQLite drivers are not installed in the server yet.

  1. If SQLite drivers are installed:
    • Uninstall drivers running sudo apt-get remove php7.x-sqlite. Replace "x" by the minor PHP version installed in the server.
    • Create a new project running composer create-project bolt/project myprojectname command.
  2. If SQLite drivers are NOT installed:
    • Create a new project running composer create-project bolt/project myprojectname command.

Expected result

Display an info/warning message when SQLite drivers are not installed, for example:

SQLite drivers are not installed. Run sudo apt-get install php7.x-sqlite. Replace "x" by the minor PHP version installed in your server.

Details

Question Answer
Relevant Bolt Version 4.0.0-rc.22
Install type Composer install
PHP version 7.4
nestordedios commented 4 years ago

I have also changed the configuration of the Database connection in .env to use a MySQL database, run php bin/console bolt:info and it throws an error when MySQL drivers are not installed.

Capture

Probably it will do the same for other Databases supported by Bolt.