phpgt / phpgt/Database

Error message: When MySQL driver is not installed

Open
#366 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
4
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I just ran into this issue: Error - Undefined constant Gt\Database\Connection\Connection::MYSQL_ATTR_INIT_COMMAND /home/g105b/Code/PhpGt/Database/src/Connection/Driver.php:49

It seems such an obscure error, but really it should say "Your PHP install does not have PDO's MySQL module installed". This should be detectable during the constructor.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Connection/Driver.php at line 49 and inspect how the constructor handles the MySQL PDO option. Reproduce the missing-driver error if possible, then make the constructor detect the absent PDO MySQL module and report that requirement clearly. Done means the obscure undefined-constant error is replaced by the requested message.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.